Jelajahi Sumber

【会员系统】P0自测问题修改

wanjun 4 bulan lalu
induk
melakukan
fb8da13494
59 mengubah file dengan 2233 tambahan dan 807 penghapusan
  1. 4 3
      PDF Office/PDF Master/AppDelegate.swift
  2. 0 1
      PDF Office/PDF Master/Class/AD/KMAdsManager.swift
  3. 2 1
      PDF Office/PDF Master/Class/AD/KMAdsWebView.swift
  4. 12 7
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/AINewConfigWindowController.swift
  5. 2 1
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIHeaderView/AIHeaderView.swift
  6. 6 2
      PDF Office/PDF Master/Class/Batch/View/KMBatchoperateConvertCollectionViewItem.swift
  7. 38 8
      PDF Office/PDF Master/Class/Batch/WindowController/KMBatchOperateLeftViewController.swift
  8. 10 3
      PDF Office/PDF Master/Class/Batch/WindowController/VC/KMBatchOperateConvertViewController.swift
  9. 17 4
      PDF Office/PDF Master/Class/Batch/WindowController/VC/KMBatchOperateImageToPDFViewController.swift
  10. 2 1
      PDF Office/PDF Master/Class/ChromiumTabs/KMBrowserWindowController.swift
  11. 11 3
      PDF Office/PDF Master/Class/GuideInfo/KMFunctionGuideWindowController.swift
  12. 127 111
      PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController+Action.swift
  13. 7 2
      PDF Office/PDF Master/Class/PDFTools/AddPassword/New/View/KMSecurityView.swift
  14. 7 2
      PDF Office/PDF Master/Class/PDFTools/Compress/Controller/KMCompressWIndowControllerNew.swift
  15. 37 21
      PDF Office/PDF Master/Class/PDFTools/Convert/NewController/KMConvertWindowController.swift
  16. 11 4
      PDF Office/PDF Master/Class/PDFTools/Convert/NewController/KMToolCompareWindowController.swift
  17. 39 13
      PDF Office/PDF Master/Class/PDFTools/Merge/MergeNew/KMMergeWindowController.swift
  18. 0 9
      PDF Office/PDF Master/Class/PDFTools/Merge/MergeNew/View/KMMergeView.swift
  19. 46 10
      PDF Office/PDF Master/Class/PDFTools/Merge/OCPart/KMPDFEditAppendWindow.m
  20. 222 85
      PDF Office/PDF Master/Class/PDFTools/PageEdit/Controller/KMPDFEditViewController.swift
  21. 9 3
      PDF Office/PDF Master/Class/PDFTools/PageEdit/Window/SplitWindowController.swift
  22. 7 2
      PDF Office/PDF Master/Class/PDFTools/Print/KMPrintWindowController.swift
  23. 34 10
      PDF Office/PDF Master/Class/PDFTools/Print/PrintHelper/PrintManage/KMPDFPrintManageWindowController.m
  24. 11 9
      PDF Office/PDF Master/Class/PDFTools/RemovePassword/New/View/KMRemovePasswordView.swift
  25. 11 4
      PDF Office/PDF Master/Class/PDFTools/RemovePassword/VC/KMBatchOperateRemovePasswordViewController.swift
  26. 7 2
      PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListView.m
  27. 64 19
      PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController+Thumbnail.swift
  28. 28 8
      PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController.swift
  29. 77 27
      PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Thumbnail/Base/KMPDFThumbViewBaseController.swift
  30. 23 7
      PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMAnnotationSelectLinkViewController.swift
  31. 7 2
      PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/PageDisplay/KMPageDisplayCustomThemesCollectionViewItem.swift
  32. 24 8
      PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/PageDisplay/KMPageDisplayPropertiesViewController.swift
  33. 7 2
      PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/PageDisplay/KMPageDisplayThemeCollectionViewItem.swift
  34. 16 4
      PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/Signature/KMSignatureAnnotationViewController.m
  35. 0 1
      PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/Signature/KMSignatureWindowController.m
  36. 29 10
      PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/StampList/KMAnnotationStampViewController.swift
  37. 12 4
      PDF Office/PDF Master/Class/PDFWindowController/TabWindowController/KMTabbingHintWindowController.swift
  38. 12 4
      PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarViewController.swift
  39. 163 56
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift
  40. 61 20
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+MenuAction.swift
  41. 41 13
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+UI.swift
  42. 43 16
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift
  43. 9 3
      PDF Office/PDF Master/Class/Preference/Controller/KMGeneralPreferences.swift
  44. 6 67
      PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseCompareDMGWindowController.m
  45. 318 168
      PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationMessageViewController.m
  46. 44 3
      PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationMessageViewController.xib
  47. 1 1
      PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationWindowController.xib
  48. 12 8
      PDF Office/PDF Master/Class/Tools/Search/Window/KMSearchReplaceWindowController.swift
  49. 22 0
      PDF Office/PDF Master/MemberCenter/Assets/MemberCenter.xcassets/Image/UserProfilePicture2.imageset/Contents.json
  50. 152 0
      PDF Office/PDF Master/MemberCenter/Assets/MemberCenter.xcassets/Image/UserProfilePicture2.imageset/Frame 1000006512.pdf
  51. 152 0
      PDF Office/PDF Master/MemberCenter/Assets/MemberCenter.xcassets/Image/UserProfilePicture2.imageset/Frame 1000006513.pdf
  52. 190 0
      PDF Office/PDF Master/MemberCenter/Model/KMMemberInfo.swift
  53. 1 0
      PDF Office/PDF Master/MemberCenter/View/KMSignUpView.swift
  54. 13 2
      PDF Office/PDF Master/MemberCenter/ViewModel/KMSignUpViewModel.swift
  55. 12 0
      PDF Office/PDF Master/MemberCenter/WindowsController/KMLoginWindowsController.swift
  56. 15 30
      PDF Office/PDF Master/MemberCenter/WindowsController/KMProductCompareWC.swift
  57. 0 1
      PDF Office/PDF Master/PDF_Reader_Pro DMG-Bridging-Header.h
  58. 0 1
      PDF Office/PDF Master/PDF_Reader_Pro Edition-Bridging-Header.h
  59. 0 1
      PDF Office/PDF Master/PDF_Reader_Pro-Bridging-Header.h

+ 4 - 3
PDF Office/PDF Master/AppDelegate.swift

@@ -719,8 +719,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, iRateDelegate{
     @objc func restoreSubscriptions(_ sender: NSMenuItem) {
 #if VERSION_FREE
         KMPrint("restoreSubscriptions ...")
-        let compareWindowVC: KMPurchaseCompareWindowController = KMPurchaseCompareWindowController.sharedInstance() as! KMPurchaseCompareWindowController
-        compareWindowVC.showWindowRestore(nil)
+        KMProductCompareWC.shared.orientation = false
+        KMProductCompareWC.shared.showWindow(nil)
 #else
         var vc: KMToolCompareWindowController? = nil
         vc = KMToolCompareWindowController.toolCompare(toolType: .Convert, selectNum: 0)
@@ -814,7 +814,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, iRateDelegate{
     
     @IBAction func aiToolsAction(_ sender: NSMenuItem) {
 #if VERSION_DMG
-        KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+        KMProductCompareWC.shared.orientation = false
+        KMProductCompareWC.shared.showWindow(nil)
 #else
         AIPurchaseWindowController.currentWC().showWindow(nil)
 #endif

+ 0 - 1
PDF Office/PDF Master/Class/AD/KMAdsManager.swift

@@ -133,7 +133,6 @@ class KMAdsManager: NSObject {
 
     func showFreeTimeAdsInfo() {
         print("KMPurchaseCompareWindowController")
-//        KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
     }
 
     func checkNetworkAvailable() -> Bool {

+ 2 - 1
PDF Office/PDF Master/Class/AD/KMAdsWebView.swift

@@ -297,7 +297,8 @@ class KMAdsWebView: NSView, WKNavigationDelegate, CAAnimationDelegate {
         }
         
         if type == .ComparisonSheet {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+            KMProductCompareWC.shared.orientation = false
+            KMProductCompareWC.shared.showWindow(nil)
         } else {
             let newURL = NSURL(string: string)
             NSWorkspace.shared.open(newURL! as URL)

+ 12 - 7
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/AINewConfigWindowController.swift

@@ -291,13 +291,18 @@ protocol AIConfigWindowDelegate: AnyObject {
     }
     
     func chooseAIFunctionWithType(_ aiConfigType: AIConfigType) -> Void {
-        if AIInfoManager.default().aiInfo.infoDict.keys.count == 0 {
-#if VERSION_DMG
-            KMPurchaseCompareWindowController.dmgPurchaseInstance().showWindow(nil)
-#else
-            AIPurchaseWindowController.currentWC().showWindow(nil)
-#endif
-            return;
+//        if AIInfoManager.default().aiInfo.infoDict.keys.count == 0 {
+//#if VERSION_DMG
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//#else
+//            AIPurchaseWindowController.currentWC().showWindow(nil)
+//#endif
+//            return;
+//        }
+        if KMMemberInfo.shared.isPermitAI == false {
+            KMMemberInfo.shared.aiSubscription()
+            return
         }
         
         if self.eventLabel.isEmpty {

+ 2 - 1
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIHeaderView/AIHeaderView.swift

@@ -73,7 +73,8 @@ class AIHeaderView: NSView, NibLoadable {
         controller.enterLicenseHandle = { vc in
             let verifyVC = KMVerificationWindowController.verification(with: .activateAIInfo)
             verifyVC?.callback = {
-                KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+                KMProductCompareWC.shared.orientation = false
+                KMProductCompareWC.shared.showWindow(nil)
             }
             verifyVC?.showWindow(nil)
             

+ 6 - 2
PDF Office/PDF Master/Class/Batch/View/KMBatchoperateConvertCollectionViewItem.swift

@@ -48,8 +48,12 @@ class KMBatchoperateConvertCollectionViewItem: NSCollectionViewItem{
     }
     
     @IBAction func buttonClicked_AdvancedClicked(_ sender: Any) {
-        if !IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if !IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//        }
+        if !KMMemberInfo.shared.isPermitConvert {
+            KMMemberInfo.shared.advancedFunctionUsage()
         }
     }
 

+ 38 - 8
PDF Office/PDF Master/Class/Batch/WindowController/KMBatchOperateLeftViewController.swift

@@ -164,13 +164,23 @@ class KMBatchOperateLeftViewController: NSViewController,NSTableViewDelegate,NST
     
     func chooseFile() {
 #if VERSION_FREE
-        if !IAPProductsManager.default().isAvailableAllFunction() {
+//        if !IAPProductsManager.default().isAvailableAllFunction() {
+//            if files.count >= 1 {
+//                let winC = KMProductCompareWC.shared
+//                if type == .CreatePDF {
+//                    winC.kEventName = "Onbrd_ImagetoPDF_BuyNow"
+//                }
+//                winC.showWindow(nil)
+//                return
+//            }
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
             if files.count >= 1 {
-                let winC = KMPurchaseCompareWindowController.sharedInstance()
+                let winC = KMProductCompareWC.shared
                 if type == .CreatePDF {
-                    winC?.kEventName = "Onbrd_ImagetoPDF_BuyNow"
+                    winC.kEventName = "Onbrd_ImagetoPDF_BuyNow"
                 }
-                winC?.showWindow(nil)
+                KMMemberInfo.shared.advancedFunctionUsage()
                 return
             }
         }
@@ -470,11 +480,20 @@ class KMBatchOperateLeftViewController: NSViewController,NSTableViewDelegate,NST
 //                UTTypeString?.release()
             }
         }
-        if !IAPProductsManager.default().isAvailableAllFunction() {
+//        if !IAPProductsManager.default().isAvailableAllFunction() {
+//            if self.files.count < 1 {
+//                pdfArray = NSMutableArray(array: [pdfArray.firstObject as Any])
+//            } else {
+//                KMProductCompareWC.shared.orientation = false
+//                KMProductCompareWC.shared.showWindow(nil)
+//                return
+//            }
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
             if self.files.count < 1 {
                 pdfArray = NSMutableArray(array: [pdfArray.firstObject as Any])
             } else {
-                KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+                KMMemberInfo.shared.advancedFunctionUsage()
                 return
             }
         }
@@ -720,13 +739,24 @@ class KMBatchOperateLeftViewController: NSViewController,NSTableViewDelegate,NST
                     }
                 }
             }
-            if !(IAPProductsManager.default().isAvailableAllFunction)() {
+//            if !(IAPProductsManager.default().isAvailableAllFunction)() {
+//                if self.files.count < 1 && insertArray.count > 0 {
+//                    let firstObject = insertArray.firstObject
+//                    insertArray.removeAllObjects()
+//                    insertArray.add(firstObject as Any)
+//                } else {
+//                    KMProductCompareWC.shared.orientation = false
+//                    KMProductCompareWC.shared.showWindow(nil)
+//                    return false
+//                }
+//            }
+            if KMMemberInfo.shared.isMemberAllFunction == false {
                 if self.files.count < 1 && insertArray.count > 0 {
                     let firstObject = insertArray.firstObject
                     insertArray.removeAllObjects()
                     insertArray.add(firstObject as Any)
                 } else {
-                    KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+                    KMMemberInfo.shared.advancedFunctionUsage()
                     return false
                 }
             }

+ 10 - 3
PDF Office/PDF Master/Class/Batch/WindowController/VC/KMBatchOperateConvertViewController.swift

@@ -720,7 +720,8 @@ class KMBatchOperateConvertViewController: KMBatchOperateBaseViewController{
                 limitWC.window?.center()
                 limitWC.showWindow(nil)
             }else{
-                let winC = KMPurchaseCompareWindowController.sharedInstance()
+                KMProductCompareWC.shared.orientation = false
+                let winC = KMProductCompareWC.shared
                 if let viewC = self.view.window?.contentViewController, viewC.kEventTag == 1 {
                     winC?.kEventName = "Onbrd_ConvertPDF_BuyNow"
                 } else {
@@ -736,10 +737,16 @@ class KMBatchOperateConvertViewController: KMBatchOperateBaseViewController{
                 winC?.showWindow(nil)
             }
 #else
-            if IAPProductsManager.default().isAvailableAllFunction() {
+//            if IAPProductsManager.default().isAvailableAllFunction() {
+//                self.convertActionVC()
+//            } else {
+//                KMProductCompareWC.shared.orientation = false
+//                KMProductCompareWC.shared.showWindow(nil)
+//            }
+            if KMMemberInfo.shared.isMemberAllFunction == true {
                 self.convertActionVC()
             } else {
-                KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+                KMMemberInfo.shared.advancedFunctionUsage()
             }
 #endif
         }

+ 17 - 4
PDF Office/PDF Master/Class/Batch/WindowController/VC/KMBatchOperateImageToPDFViewController.swift

@@ -378,11 +378,18 @@ class KMBatchOperateImageToPDFViewController: KMBatchOperateBaseViewController,
     
     @IBAction func buttonClicked_OCRSelect(_ sender: NSButton) {
         //MARK: 判断是否付费用户
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            self.ocrSelectBtn.state = .off
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             self.ocrSelectBtn.state = .off
             return
         }
+
         if (sender.state == .on) {
             self.languageButton.isEnabled = true
             self.planButton.isEnabled = true
@@ -423,10 +430,16 @@ class KMBatchOperateImageToPDFViewController: KMBatchOperateBaseViewController,
         if self.files?.count ?? 0 < 1 {
             return
         }
-        if IAPProductsManager.default().isAvailableAllFunction() == false && self.files?.count ?? 0 > 1{
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if IAPProductsManager.default().isAvailableAllFunction() == false && self.files?.count ?? 0 > 1{
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false && self.files?.count ?? 0 > 1 {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
+
         if sender.tag == 1 {
             self.choosePath = ""
             var hasTask = false

+ 2 - 1
PDF Office/PDF Master/Class/ChromiumTabs/KMBrowserWindowController.swift

@@ -640,7 +640,8 @@ extension KMBrowserWindowController: KMToolbarRightViewDelegate {
         self.trackEvent_upgrade()
 //        KMComparativeTableViewController.show(window: self.window!, .upgrade)
         DispatchQueue.main.async {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+            KMProductCompareWC.shared.orientation = false
+            KMProductCompareWC.shared.showWindow(nil)
         }
     }
     

+ 11 - 3
PDF Office/PDF Master/Class/GuideInfo/KMFunctionGuideWindowController.swift

@@ -124,11 +124,19 @@ class KMFunctionGuideWindowController: NSWindowController {
                             AIPurchaseWindowController.currentWC().showWindow(nil)
                         }
                     } else if controller.currentNameKEY == controller.MeasureInfoKey {
-                        if IAPProductsManager.default().isAvailableAllFunction() {
+//                        if IAPProductsManager.default().isAvailableAllFunction() {
+//                            self?.closeAction()
+//                        } else {
+//                            KMProductCompareWC.shared.orientation = false
+//                            let singleTon = KMProductCompareWC.shared
+//                            singleTon.showWindow(nil)
+//                            singleTon.window?.center()
+//                        }
+                        if KMMemberInfo.shared.isMemberAllFunction == true {
                             self?.closeAction()
                         } else {
-                            let singleTon = KMPurchaseCompareWindowController.init()
-                            singleTon.showWindow(nil)
+                            let singleTon = KMProductCompareWC.shared
+                            KMMemberInfo.shared.advancedFunctionUsage()
                             singleTon.window?.center()
                         }
                     }

+ 127 - 111
PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController+Action.swift

@@ -987,9 +987,13 @@ extension KMHomeViewController {
     }
     
     func fastTool_Batch() { // Batch
-//        KMBatchWindowController.openFile(nil, .Batch)
-        if !IAPProductsManager.default().isAvailableAllFunction(){
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if !IAPProductsManager.default().isAvailableAllFunction(){
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         let batchWindowController = KMBatchOperateWindowController.sharedWindowController
@@ -997,11 +1001,17 @@ extension KMHomeViewController {
     }
     
     func fastTool_OCR() {   // OCR
-//        KMOCRWindowController.openFiles(window: self.view.window!)
-        if !IAPProductsManager.default().isAvailableAllFunction(){
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
-            winC?.kEventName = "Onbrd_OCR_BuyNow"
-            winC?.showWindow(nil)
+//        if !IAPProductsManager.default().isAvailableAllFunction(){
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            winC.kEventName = "Onbrd_OCR_BuyNow"
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
+            winC.kEventName = "Onbrd_OCR_BuyNow"
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         let openPanel = NSOpenPanel()
@@ -1322,10 +1332,17 @@ extension KMHomeViewController {
     }
     
     func fastTool_FileCompare() {    // 文件对比
-        if !IAPProductsManager.default().isAvailableAllFunction(){
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
-            winC?.kEventName = "Onbrd_Compare_BuyNow"
-            winC?.showWindow(nil)
+//        if !IAPProductsManager.default().isAvailableAllFunction(){
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            winC.kEventName = "Onbrd_Compare_BuyNow"
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
+            winC.kEventName = "Onbrd_Compare_BuyNow"
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         let openPanel = NSOpenPanel()
@@ -1427,14 +1444,20 @@ extension KMHomeViewController {
     }
     
     func fastTool_Watermark() { // 水印
-//        KMBatchWindowController.openFile(nil, .Watermark)
-        if !IAPProductsManager.default().isAvailableAllFunction(){
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
-            winC?.kEventName = "Onbrd_Watermard_BuyNow"
-            winC?.showWindow(nil)
+//        if !IAPProductsManager.default().isAvailableAllFunction(){
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            winC.kEventName = "Onbrd_Watermard_BuyNow"
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
+            winC.kEventName = "Onbrd_Watermard_BuyNow"
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
-        
+
         let openPanel = NSOpenPanel()
         openPanel.allowedFileTypes = ["pdf","PDF"]
         //MARK: 允许多选还是单选,如果是付费用户允许多选
@@ -1475,11 +1498,17 @@ extension KMHomeViewController {
     }
     
     func fastTool_Background() {    // 背景
-//        KMBatchWindowController.openFile(nil, .Background)
-        if !IAPProductsManager.default().isAvailableAllFunction(){
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
-            winC?.kEventName = "Onbrd_Background_BuyNow"
-            winC?.showWindow(nil)
+//        if !IAPProductsManager.default().isAvailableAllFunction(){
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            winC.kEventName = "Onbrd_Background_BuyNow"
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
+            winC.kEventName = "Onbrd_Background_BuyNow"
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
 
@@ -1523,11 +1552,17 @@ extension KMHomeViewController {
     }
     
     func fastTool_HeaderAndFooter() {   // 页眉页脚
-//        KMBatchWindowController.openFile(nil, .HeaderAndFooter)
-        if !IAPProductsManager.default().isAvailableAllFunction(){
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
-            winC?.kEventName = "Onbrd_HeaderFooter_BuyNow"
-            winC?.showWindow(nil)
+//        if !IAPProductsManager.default().isAvailableAllFunction(){
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            winC.kEventName = "Onbrd_HeaderFooter_BuyNow"
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
+            winC.kEventName = "Onbrd_HeaderFooter_BuyNow"
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
 
@@ -1572,11 +1607,17 @@ extension KMHomeViewController {
     
     
     func fastTool_BatesCode() { // 贝茨码
-//        KMBatchWindowController.openFile(nil, .BatesCode)
-        if !IAPProductsManager.default().isAvailableAllFunction(){
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
-            winC?.kEventName = "Onbrd_Bates_BuyNow"
-            winC?.showWindow(nil)
+//        if !IAPProductsManager.default().isAvailableAllFunction(){
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            winC.kEventName = "Onbrd_Bates_BuyNow"
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
+            winC.kEventName = "Onbrd_Bates_BuyNow"
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
 
@@ -1628,8 +1669,13 @@ extension KMHomeViewController {
     }
     
     func fastTool_Insert() {    // 插入
-        if !IAPProductsManager.default().isAvailableAllFunction(){
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if !IAPProductsManager.default().isAvailableAllFunction(){
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
 
@@ -1640,24 +1686,10 @@ extension KMHomeViewController {
         
         openPanel.beginSheetModal(for: NSApp.mainWindow!) { result in
             if result == .OK {
-                //                DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) {
-                //                    let insertWindowController: KMPDFInsertPageWindow = KMPDFInsertPageWindow.init(documentPath: openPanel.url!, toolType: .Insert)
-                //                    insertWindowController.beginSheetModal(for: self.view.window!) { pdfDocument, password, pages, indexPage in
-                //                        self.insertPageAction(pdfDocument, password, pages, indexPage)
-                //                    }
-                //                }
-                //            }
                 let windowC = KMPDFInsertWindowController(fileURL: openPanel.url!)
-//                [com beginSheetModalForWindow:[NSApp mainWindow] completionHandler:^(PDFDocument *pdfDocument, NSString *password, NSMutableArray<PDFPage *> *pages, NSInteger indexPage) {
-//                    if (pdfDocument && indexPage >= 0) {
-//                        [pdfDocument insertWithInsertPages:pages insertPageIndex:indexPage];
-//                        [self savePDFDocument:pdfDocument password:password];
-//                    }
-//                }];
                 windowC.callback = { [weak self] idx, params in
                     if params.count >= 4 {
                         if let doc = params.first as? CPDFDocument {
-//                            doc.insertWithInsertPages((params[2] as? [CPDFPage]) ?? [], insertPageIndex: params[3] as! Int)
                             self?.savePDFDocument(doc, password: params[1] as? String ?? "")
                         }
                     }
@@ -1668,55 +1700,14 @@ extension KMHomeViewController {
         }
     }
     
-    
-//    func savePDFDocument(_ pdf: CPDFDocument, password: String?) {
-////        KMProgressWindowController * vc = [[KMProgressWindowController alloc] init];
-////        [NSApp beginSheet:[vc window] modalForWindow:[NSApp mainWindow] modalDelegate:nil didEndSelector:nil contextInfo:NULL];
-//
-//        DispatchQueue.global().async {
-//            var isSuccessfully = false
-//            if (pdf.isEncrypted) {
-//                isSuccessfully = pdf.write(to: pdf.documentURL, withOptions: [.userPasswordOption : password ?? "", .ownerPasswordOption : password ?? ""])
-//            } else {
-//                isSuccessfully = pdf.write(to: pdf.documentURL)
-//            }
-//            if (!isSuccessfully) {
-////                isSuccessfully = [pdf.dataRepresentation writeToURL:pdf.documentURL atomically:YES];
-//                try?pdf.dataRepresentation().write(to: pdf.documentURL)
-//            }
-//
-//            Task { @MainActor in
-////                [NSApp endSheet:vc.window];
-////                [vc close];
-//
-//                if (isSuccessfully) {
-////                    BOOL autoOpen = [[NSUserDefaults standardUserDefaults] boolForKey:KMAutoOpenDocumentKey];
-////                    if (autoOpen) {
-////                        [[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL:pdf.documentURL display:YES completionHandler:^(NSDocument * _Nullable document, BOOL documentWasAlreadyOpen, NSError * _Nullable error) {
-////
-////                        }];
-////                    } else {
-//                    let workspace = NSWorkspace.shared
-//                    let url = URL(fileURLWithPath: pdf.documentURL.path)
-//                    workspace.activateFileViewerSelecting([url])
-////                    }
-//                } else {
-//                    _ = await KMAlertTool.runModel(message: KMLocalizedString("Failed to insert page(s)!", nil))
-//                }
-//            }
-//        }
-//    }
-    
     func fastTool_BreakUp() {   // 拆分
-//        [[FMTrackEventManager manager] trackEvent:@"Onbrd" withProperties:@{@"HP_Tools":@"Split"}];
-//
-//        if (![IAPProductsManager defaultManager].isAvailableAllFunction) {
-//            [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
-//            return;
+//        if !IAPProductsManager.default().isAvailableAllFunction(){
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
 //        }
-//        self.isDragEntered = YES;
-        if !IAPProductsManager.default().isAvailableAllFunction(){
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
 
@@ -1724,7 +1715,6 @@ extension KMHomeViewController {
         openPanel.allowedFileTypes = ["pdf"]
         openPanel.allowsMultipleSelection = false
         openPanel.beginSheetModal(for: NSApp.mainWindow!) { result in
-//            self.isDragEntered = NO;
             if result == .OK {
                 DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) {
                     let com = SplitWindowController(fileURL: openPanel.url!)
@@ -1752,8 +1742,13 @@ extension KMHomeViewController {
     }
     
     func fastTool_MarkCipher() {    // 标记密文
-        if !IAPProductsManager.default().isAvailableAllFunction(){
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if !IAPProductsManager.default().isAvailableAllFunction(){
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         
@@ -1829,10 +1824,17 @@ extension KMHomeViewController {
     }
     
     func fastTool_printBooklet() {
-        if !IAPProductsManager.default().isAvailableAllFunction(){
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
-            winC?.kEventName = "Onbrd_PrintBooklet_BuyNow"
-            winC?.showWindow(nil)
+//        if !IAPProductsManager.default().isAvailableAllFunction(){
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            winC.kEventName = "Onbrd_PrintBooklet_BuyNow"
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
+            winC.kEventName = "Onbrd_PrintBooklet_BuyNow"
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
 
@@ -1869,10 +1871,17 @@ extension KMHomeViewController {
     }
     
     func fastTool_printPoster() {
-        if !IAPProductsManager.default().isAvailableAllFunction(){
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
-            winC?.kEventName = "Onbrd_PrintPoster_BuyNow"
-            winC?.showWindow(nil)
+//        if !IAPProductsManager.default().isAvailableAllFunction(){
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            winC.kEventName = "Onbrd_PrintPoster_BuyNow"
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
+            winC.kEventName = "Onbrd_PrintPoster_BuyNow"
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
 
@@ -1909,10 +1918,17 @@ extension KMHomeViewController {
     }
     
     func fastTool_printMultple() {
-        if !IAPProductsManager.default().isAvailableAllFunction(){
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
-            winC?.kEventName = "Onbrd_PrintMultiple_BuyNow"
-            winC?.showWindow(nil)
+//        if !IAPProductsManager.default().isAvailableAllFunction(){
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            winC.kEventName = "Onbrd_PrintMultiple_BuyNow"
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
+            winC.kEventName = "Onbrd_PrintMultiple_BuyNow"
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
 

+ 7 - 2
PDF Office/PDF Master/Class/PDFTools/AddPassword/New/View/KMSecurityView.swift

@@ -159,8 +159,13 @@ extension KMSecurityView {
 
 extension KMSecurityView {
     @IBAction func batchButtonAction(_ sender: Any) {
-        if !IAPProductsManager.default().isAvailableAllFunction(){
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if !IAPProductsManager.default().isAvailableAllFunction(){
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         guard let callBack = batchAction else { return }

+ 7 - 2
PDF Office/PDF Master/Class/PDFTools/Compress/Controller/KMCompressWIndowControllerNew.swift

@@ -62,8 +62,13 @@ class KMCompressWIndowControllerNew: KMBaseWindowController {
         
         self.compressView.batchAction = { [unowned self] view in
             print("Batch 按钮点击")
-            if !IAPProductsManager.default().isAvailableAllFunction(){
-                KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//            if !IAPProductsManager.default().isAvailableAllFunction(){
+//                KMProductCompareWC.shared.orientation = false
+//                KMProductCompareWC.shared.showWindow(nil)
+//                return
+//            }
+            if KMMemberInfo.shared.isMemberAllFunction == false {
+                KMMemberInfo.shared.advancedFunctionUsage()
                 return
             }
             guard let callBack = batchAction else { return }

+ 37 - 21
PDF Office/PDF Master/Class/PDFTools/Convert/NewController/KMConvertWindowController.swift

@@ -711,8 +711,13 @@ let kConvertFileSavePath = (kTempSavePath?.stringByAppendingPathComponent("conve
         }
     }
     @IBAction func buttonClicked_Batch(_ sender: NSButton) {
-        if !IAPProductsManager.default().isAvailableAllFunction() {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if !IAPProductsManager.default().isAvailableAllFunction() {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         if self.pdfDocument?.documentURL == nil {
@@ -1018,50 +1023,61 @@ let kConvertFileSavePath = (kTempSavePath?.stringByAppendingPathComponent("conve
             limitWC.window?.center()
             limitWC.showWindow(nil)
         } else {
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
+            KMProductCompareWC.shared.orientation = false
+            let winC = KMProductCompareWC.shared
             if convertType == .Word || convertType == .AdvancedWord {
-                winC?.kEventName = "Reading_PDFtoWord_BuyNow"
+                winC.kEventName = "Reading_PDFtoWord_BuyNow"
             } else if convertType == .Excel {
-                winC?.kEventName = "Reading_PDFtoExcel_BuyNow"
+                winC.kEventName = "Reading_PDFtoExcel_BuyNow"
             } else if convertType == .PPT {
-                winC?.kEventName = "Reading_PDFtoPPT_BuyNow"
+                winC.kEventName = "Reading_PDFtoPPT_BuyNow"
             } else if convertType == .RTF {
-                winC?.kEventName = "Reading_PDFtoRTF_BuyNow"
+                winC.kEventName = "Reading_PDFtoRTF_BuyNow"
             } else if convertType == .CSV {
-                winC?.kEventName = "Reading_PDFtoCSV_BuyNow"
+                winC.kEventName = "Reading_PDFtoCSV_BuyNow"
             } else if convertType == .Text {
-                winC?.kEventName = "Reading_PDFtoText_BuyNow"
+                winC.kEventName = "Reading_PDFtoText_BuyNow"
             }
             if convertType == .JPEG || convertType == .JPG || convertType == .PNG || convertType == .GIF || convertType == .TIFF || convertType == .TGA || convertType == .BMP || convertType == .JP2 {
-                winC?.kEventName = "Reading_PDFtoImage_BuyNow"
+                winC.kEventName = "Reading_PDFtoImage_BuyNow"
             }
-//            else if convertType == . {
-//                winC?.kEventName = "Reading_PDFtoExcel_BuyNow"
-//            }
-            winC?.showWindow(nil)
+            winC.showWindow(nil)
         }
 #else
-        if IAPProductsManager.default().isAvailableAllFunction() {
+//        if IAPProductsManager.default().isAvailableAllFunction() {
+//            var vc: KMToolCompareWindowController? = nil
+//            if convertType == .Word || convertType == .AdvancedWord {
+//                vc = KMToolCompareWindowController.toolCompare(toolType: .Convert, selectNum: 1)
+//            } else if convertType == .Excel {
+//                vc = KMToolCompareWindowController.toolCompare(toolType: .Convert, selectNum: 2)
+//            } else if convertType == .PPT {
+//                vc = KMToolCompareWindowController.toolCompare(toolType: .Convert, selectNum: 3)
+//            } else if convertType.rawValue < 15 && convertType.rawValue > 7 {
+//                vc = KMToolCompareWindowController.toolCompare(toolType: .Convert, selectNum: 4)
+//            } else {
+//                vc = KMToolCompareWindowController.toolCompare(toolType: .Convert, selectNum: 0)
+//            }
+//            vc?.showWindow(nil)
+//        } else {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == true {
             var vc: KMToolCompareWindowController? = nil
             if convertType == .Word || convertType == .AdvancedWord {
-//                vc = KMToolCompareWindowController(toolType: .Convert, selectNum: 1)
                 vc = KMToolCompareWindowController.toolCompare(toolType: .Convert, selectNum: 1)
             } else if convertType == .Excel {
-//                vc = KMToolCompareWindowController(toolType: .Convert, selectNum: 2)
                 vc = KMToolCompareWindowController.toolCompare(toolType: .Convert, selectNum: 2)
             } else if convertType == .PPT {
-//                vc = KMToolCompareWindowController(toolType: .Convert, selectNum: 3)
                 vc = KMToolCompareWindowController.toolCompare(toolType: .Convert, selectNum: 3)
             } else if convertType.rawValue < 15 && convertType.rawValue > 7 {
-//                vc = KMToolCompareWindowController(toolType: .Convert, selectNum: 4)
                 vc = KMToolCompareWindowController.toolCompare(toolType: .Convert, selectNum: 4)
             } else {
-//                vc = KMToolCompareWindowController(toolType: .Convert, selectNum: 0)
                 vc = KMToolCompareWindowController.toolCompare(toolType: .Convert, selectNum: 0)
             }
             vc?.showWindow(nil)
         } else {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+            KMMemberInfo.shared.advancedFunctionUsage()
         }
 #endif
         self.buttonClicked_Cancel(self.cancelButton)

+ 11 - 4
PDF Office/PDF Master/Class/PDFTools/Convert/NewController/KMToolCompareWindowController.swift

@@ -51,7 +51,6 @@ var currentWindowController: KMToolCompareWindowController? = nil
                 if #available(macOS 10.13, *) {
                     self.close()
                 }
-//                KMPurchaseCompareWindowController.sharedInstance().startModal("")
             } else if type == .license {
                 self.close()
                 if VerificationManager.default().status == .none {
@@ -61,13 +60,21 @@ var currentWindowController: KMToolCompareWindowController? = nil
                     let vc = KMVerificationWindowController.verification(with: .activate)
                     vc?.callback = { [weak self] in
 #if VERSION_DMG
-                        KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+                        KMProductCompareWC.shared.orientation = false
+                        KMProductCompareWC.shared.showWindow(nil)
 #else
-                        if IAPProductsManager.default().isAvailableAllFunction() {
+//                        if IAPProductsManager.default().isAvailableAllFunction() {
+//                            let vc = KMToolCompareWindowController.toolCompare(toolType: self?.type ?? .Convert, selectNum: self?.selectIndex ?? 0)
+//                            vc.showWindow(nil)
+//                        } else {
+//                            KMProductCompareWC.shared.orientation = false
+//                            KMProductCompareWC.shared.showWindow(nil)
+//                        }
+                        if KMMemberInfo.shared.isMemberAllFunction == false {
                             let vc = KMToolCompareWindowController.toolCompare(toolType: self?.type ?? .Convert, selectNum: self?.selectIndex ?? 0)
                             vc.showWindow(nil)
                         } else {
-                            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+                            KMMemberInfo.shared.advancedFunctionUsage()
                         }
 #endif
                     }

+ 39 - 13
PDF Office/PDF Master/Class/PDFTools/Merge/MergeNew/KMMergeWindowController.swift

@@ -98,14 +98,25 @@ extension KMMergeWindowController {
             size = size + file.fileSize
         }
         
-        if !IAPProductsManager.default().isAvailableAllFunction() && (files.count >= 2 || size > 20 * 1024 * 1024) {
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
+//        if !IAPProductsManager.default().isAvailableAllFunction() && (files.count >= 2 || size > 20 * 1024 * 1024) {
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            if self.kEventTag == 1 {
+//                winC.kEventName = "Onbrd_Merge_BuyNow"
+//            } else {
+//                winC.kEventName = "Reading_Merge_BuyNow"
+//            }
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false && (files.count >= 2 || size > 20 * 1024 * 1024) {
+            let winC = KMProductCompareWC.shared
             if self.kEventTag == 1 {
-                winC?.kEventName = "Onbrd_Merge_BuyNow"
+                winC.kEventName = "Onbrd_Merge_BuyNow"
             } else {
-                winC?.kEventName = "Reading_Merge_BuyNow"
+                winC.kEventName = "Reading_Merge_BuyNow"
             }
-            winC?.showWindow(nil)
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         
@@ -145,8 +156,13 @@ extension KMMergeWindowController {
                                     let fileSize = attribe?[FileAttributeKey.size] as? CGFloat ?? 0
                                     size = fileSize + size
 
-                                    if !IAPProductsManager.default().isAvailableAllFunction() && (files.count >= 2 || size > 20 * 1024 * 1024) {
-                                        KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//                                    if !IAPProductsManager.default().isAvailableAllFunction() && (files.count >= 2 || size > 20 * 1024 * 1024) {
+//                                        KMProductCompareWC.shared.orientation = false
+//                                        KMProductCompareWC.shared.showWindow(nil)
+//                                        return
+//                                    }
+                                    if KMMemberInfo.shared.isMemberAllFunction == false && (files.count >= 2 || size > 20 * 1024 * 1024) {
+                                        KMMemberInfo.shared.advancedFunctionUsage()
                                         return
                                     }
                                     
@@ -167,11 +183,16 @@ extension KMMergeWindowController {
                 let fileSize = attribe?[FileAttributeKey.size] as? CGFloat ?? 0
                 size = fileSize + size
 
-                if !IAPProductsManager.default().isAvailableAllFunction() && (files.count >= 2 || size > 20 * 1024 * 1024) {
-                    KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//                if !IAPProductsManager.default().isAvailableAllFunction() && (files.count >= 2 || size > 20 * 1024 * 1024) {
+//                    KMProductCompareWC.shared.orientation = false
+//                    KMProductCompareWC.shared.showWindow(nil)
+//                    return
+//                }
+                if KMMemberInfo.shared.isMemberAllFunction == false && (files.count >= 2 || size > 20 * 1024 * 1024) {
+                    KMMemberInfo.shared.advancedFunctionUsage()
                     return
                 }
-                
+
                 self.mergeView.addFilePaths(urls: array)
             }
         }
@@ -200,11 +221,16 @@ extension KMMergeWindowController {
             size = size + file.fileSize
         }
         
-        if !IAPProductsManager.default().isAvailableAllFunction() && (files.count >= 2 || size > 20 * 1024 * 1024) {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if !IAPProductsManager.default().isAvailableAllFunction() && (files.count >= 2 || size > 20 * 1024 * 1024) {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false && (files.count >= 2 || size > 20 * 1024 * 1024) {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
-        
+
         var filesCount = 1
         if self.oriDucumentUrl != nil {
             filesCount = 0

+ 0 - 9
PDF Office/PDF Master/Class/PDFTools/Merge/MergeNew/View/KMMergeView.swift

@@ -427,15 +427,6 @@ extension KMMergeView {
                     file.oriFilePath = fileUrl.path
                     file.myPDFDocument = document
                     
-//                    let attribe = try?FileManager.default.attributesOfItem(atPath: fileURL.path)
-//                    let fileSize = attribe?[FileAttributeKey.size] as? CGFloat ?? 0
-//                    size = fileSize + size
-//
-//                    if !IAPProductsManager.default().isAvailableAllFunction() && (files.count >= 2 || size > 20 * 1024 * 1024) {
-//                        KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
-//                        return
-//                    }
-                    
                     self.files.append(file)
                 }
             }

+ 46 - 10
PDF Office/PDF Master/Class/PDFTools/Merge/OCPart/KMPDFEditAppendWindow.m

@@ -446,10 +446,21 @@ static KMPDFEditAppendWindow *windowController = nil;
             CGFloat fileSize = [[attrib objectForKey:NSFileSize] floatValue];
             
             weakSelf.allFileSize =  weakSelf.allFileSize + fileSize;
-            if (![IAPProductsManager defaultManager].isAvailableAllFunction) {
+//            if (![IAPProductsManager defaultManager].isAvailableAllFunction) {
+//                //免費版只支援2個檔案做合併小于20M的文件合并
+//                if (self->_files.count >= 2 || self.allFileSize > (20 * 1024 * 1024)) {
+//                    [[KMProductCompareWC shared] setOrientation:NO];
+//                    [[KMProductCompareWC shared] showWindow:nil];
+//                    self.allFileSize = self.allFileSize - fileSize;
+//
+//                    [self addFiles:array];
+//                    return;
+//                }
+//            }
+            if (![KMMemberInfo shared].isMemberAllFunction) {
                 //免費版只支援2個檔案做合併小于20M的文件合并
                 if (self->_files.count >= 2 || self.allFileSize > (20 * 1024 * 1024)) {
-                    [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
+                    [[KMMemberInfo shared] advancedFunctionUsage];
                     self.allFileSize = self.allFileSize - fileSize;
 
                     [self addFiles:array];
@@ -1095,10 +1106,21 @@ static KMPDFEditAppendWindow *windowController = nil;
             CGFloat fileSize = [[attrib objectForKey:NSFileSize] floatValue];
             
             self.allFileSize = self.allFileSize + fileSize;
-            if (![IAPProductsManager defaultManager].isAvailableAllFunction) {
+//            if (![IAPProductsManager defaultManager].isAvailableAllFunction) {
+//                //免費版只支援2個檔案做合併小于20M的文件合并
+//                if (_files.count >= 2 || self.allFileSize > (20 * 1024 * 1024)) {
+//                    [[KMProductCompareWC shared] setOrientation:NO];
+//                    [[KMProductCompareWC shared] showWindow:nil];
+//                    self.allFileSize = self.allFileSize - fileSize;
+//                    [self addFiles:array];
+//                    result = YES;
+//                    return NO;
+//                }
+//            }
+            if (![KMMemberInfo shared].isMemberAllFunction) {
                 //免費版只支援2個檔案做合併小于20M的文件合并
                 if (_files.count >= 2 || self.allFileSize > (20 * 1024 * 1024)) {
-                    [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
+                    [[KMMemberInfo shared] advancedFunctionUsage];
                     self.allFileSize = self.allFileSize - fileSize;
                     [self addFiles:array];
                     result = YES;
@@ -1303,13 +1325,19 @@ static KMPDFEditAppendWindow *windowController = nil;
         
     }
     
-    if (![IAPProductsManager defaultManager].isAvailableAllFunction) {
+//    if (![IAPProductsManager defaultManager].isAvailableAllFunction) {
+//        if (allSize > (20 * 1024 * 1024) || _files.count > 2) {
+//            [[KMProductCompareWC shared] setOrientation:NO];
+//            [[KMProductCompareWC shared] showWindow:nil];
+//            return;
+//        }
+//    }
+    if (![KMMemberInfo shared].isMemberAllFunction) {
         if (allSize > (20 * 1024 * 1024) || _files.count > 2) {
-            [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
+            [[KMMemberInfo shared] advancedFunctionUsage];
             return;
         }
     }
-    
     _isSuccessfully = NO;
     [self.nCancelVC setEnabled:NO];
     self.canMerge = NO;
@@ -1592,13 +1620,21 @@ static KMPDFEditAppendWindow *windowController = nil;
 
 - (IBAction)buttonItemClicked_AddFile:(id)sender
 {
-    if (![IAPProductsManager defaultManager].isAvailableAllFunction) {
+//    if (![IAPProductsManager defaultManager].isAvailableAllFunction) {
+//        //免費版只支援2個檔案做合併小于20M的文件合并
+//        if (_files.count >= 2 || self.allFileSize > (20 * 1024 * 1024)) {
+//            [[KMProductCompareWC shared] setOrientation:NO];
+//            [[KMProductCompareWC shared] showWindow:nil];
+//            return;
+//        }
+//        
+//    }
+    if (![KMMemberInfo shared].isMemberAllFunction) {
         //免費版只支援2個檔案做合併小于20M的文件合并
         if (_files.count >= 2 || self.allFileSize > (20 * 1024 * 1024)) {
-            [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
+            [[KMMemberInfo shared] advancedFunctionUsage];
             return;
         }
-        
     }
     NSMenu *menu = [[NSMenu alloc] init];
     NSMenuItem *addFileItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"add files", "") action:@selector(itemAddFileAction) keyEquivalent:@""];

+ 222 - 85
PDF Office/PDF Master/Class/PDFTools/PageEdit/Controller/KMPDFEditViewController.swift

@@ -510,10 +510,16 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
     }
     
     override func cutAction() {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
+
         let pageCnt = self.pdfDocument?.pageCount ?? 0
         if (self.thumbnailView.selectionIndexPaths.count == pageCnt) {
             self._progressHUD(message: NSLocalizedString("Can not delete all pages.", comment: ""))
@@ -529,14 +535,25 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
     }
     
     override func deleteAction() {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            if self.kEventTag == 1 {
+//                winC.kEventName = "Onbrd_EditPage_BuyNow"
+//            } else {
+//                winC.kEventName = "Reading_Delete_BuyNow"
+//            }
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
             if self.kEventTag == 1 {
-                winC?.kEventName = "Onbrd_EditPage_BuyNow"
+                winC.kEventName = "Onbrd_EditPage_BuyNow"
             } else {
-                winC?.kEventName = "Reading_Delete_BuyNow"
+                winC.kEventName = "Reading_Delete_BuyNow"
             }
-            winC?.showWindow(nil)
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         
@@ -575,16 +592,19 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
     }
     
     override func leftRotateAction() {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         
         self.trackEvent(type: .leftRotate)
         
         super.leftRotateAction()
-        
-//        self.toolBar.unSelectItem(for: KMToolbarPageEditLeftRotateItemIdentifier)
     }
     
     override func leftRotateIndexpaths(indexpaths: Set<IndexPath>) {
@@ -596,14 +616,25 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
     }
     
     override func rightRotateAction() {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            if self.kEventTag == 1 {
+//                winC.kEventName = "Onbrd_EditPage_BuyNow"
+//            } else {
+//                winC.kEventName = "Reading_Rotate_BuyNow"
+//            }
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
             if self.kEventTag == 1 {
-                winC?.kEventName = "Onbrd_EditPage_BuyNow"
+                winC.kEventName = "Onbrd_EditPage_BuyNow"
             } else {
-                winC?.kEventName = "Reading_Rotate_BuyNow"
+                winC.kEventName = "Reading_Rotate_BuyNow"
             }
-            winC?.showWindow(nil)
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         
@@ -615,8 +646,6 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
         self.trackEvent(type: .rightRotate)
         
         super.rightRotateAction()
-        
-//        self.toolBar.unSelectItem(for: KMToolbarPageEditRightRotateItemIdentifier)
     }
     
     override func rightRotateIndexpaths(indexpaths: Set<IndexPath>) {
@@ -638,8 +667,13 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
     }
     
     override func pasteAction() {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         
@@ -667,8 +701,13 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
     }
     
     override func pastePage(at index: Int) {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         
@@ -676,14 +715,25 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
     }
     
     override func extractAction() {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            if self.kEventTag == 1 {
+//                winC.kEventName = "Onbrd_EditPage_BuyNow"
+//            } else {
+//                winC.kEventName = "Reading_Extract_BuyNow"
+//            }
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
             if self.kEventTag == 1 {
-                winC?.kEventName = "Onbrd_EditPage_BuyNow"
+                winC.kEventName = "Onbrd_EditPage_BuyNow"
             } else {
-                winC?.kEventName = "Reading_Extract_BuyNow"
+                winC.kEventName = "Reading_Extract_BuyNow"
             }
-            winC?.showWindow(nil)
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         
@@ -702,14 +752,25 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
     }
     
     override func replaceAction() {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            if self.kEventTag == 1 {
+//                winC.kEventName = "Onbrd_EditPage_BuyNow"
+//            } else {
+//                winC.kEventName = "Reading_Replace_BuyNow"
+//            }
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
             if self.kEventTag == 1 {
-                winC?.kEventName = "Onbrd_EditPage_BuyNow"
+                winC.kEventName = "Onbrd_EditPage_BuyNow"
             } else {
-                winC?.kEventName = "Reading_Replace_BuyNow"
+                winC.kEventName = "Reading_Replace_BuyNow"
             }
-            winC?.showWindow(nil)
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         
@@ -744,14 +805,25 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
     }
     
     override func splitAction() {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            if self.kEventTag == 1 {
+//                winC.kEventName = "Onbrd_EditPage_BuyNow"
+//            } else {
+//                winC.kEventName = "Reading_Split_BuyNow"
+//            }
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
             if self.kEventTag == 1 {
-                winC?.kEventName = "Onbrd_EditPage_BuyNow"
+                winC.kEventName = "Onbrd_EditPage_BuyNow"
             } else {
-                winC?.kEventName = "Reading_Split_BuyNow"
+                winC.kEventName = "Reading_Split_BuyNow"
             }
-            winC?.showWindow(nil)
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         
@@ -773,8 +845,13 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
     }
     
     func splitMethod(windowC: KMPageEditSplitWindowController, model: KMPageEditSplitSettingModel, limit: Bool = false) {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         
@@ -787,23 +864,25 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
     }
     
     func splitMenuAction() {
-//        if (![IAPProductsManager defaultManager].isAvailableAllFunction) {
-//    #if VERSION_DMG
-//            [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
-//    #else
-//            KMToolCompareWindowController * vc = [KMToolCompareWindowController toolCompareWithType:KMCompareWithToolType_PageEdit setSelectIndex:1];
-//            [vc startModal:nil];
-//    #endif
-//            return;
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            if self.kEventTag == 1 {
+//                winC.kEventName = "Onbrd_EditPage_BuyNow"
+//            } else {
+//                winC.kEventName = "Reading_Split_BuyNow"
+//            }
+//            winC.showWindow(nil)
+//            return
 //        }
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
             if self.kEventTag == 1 {
-                winC?.kEventName = "Onbrd_EditPage_BuyNow"
+                winC.kEventName = "Onbrd_EditPage_BuyNow"
             } else {
-                winC?.kEventName = "Reading_Split_BuyNow"
+                winC.kEventName = "Reading_Split_BuyNow"
             }
-            winC?.showWindow(nil)
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         
@@ -881,10 +960,17 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
     }
     
     override func reverseAction() {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
-            winC?.kEventName = "Reading_Reverse_BuyNow"
-            winC?.showWindow(nil)
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            winC.kEventName = "Reading_Reverse_BuyNow"
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
+            winC.kEventName = "Reading_Reverse_BuyNow"
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         
@@ -1369,14 +1455,25 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
     }
     
     @objc func item_insertCustomPage(sender: NSMenuItem?) {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            if self.kEventTag == 1 {
+//                winC.kEventName = "Onbrd_EditPage_BuyNow"
+//            } else {
+//                winC.kEventName = "Reading_InsertBlankPage_BuyNow"
+//            }
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
             if self.kEventTag == 1 {
-                winC?.kEventName = "Onbrd_EditPage_BuyNow"
+                winC.kEventName = "Onbrd_EditPage_BuyNow"
             } else {
-                winC?.kEventName = "Reading_InsertBlankPage_BuyNow"
+                winC.kEventName = "Reading_InsertBlankPage_BuyNow"
             }
-            winC?.showWindow(nil)
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         
@@ -1430,14 +1527,25 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
     }
     
     @objc func item_insertFromImage(sender: NSMenuItem?) {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            if self.kEventTag == 1 {
+//                winC.kEventName = "Onbrd_EditPage_BuyNow"
+//            } else {
+//                winC.kEventName = "Reading_InsertImage_BuyNow"
+//            }
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
             if self.kEventTag == 1 {
-                winC?.kEventName = "Onbrd_EditPage_BuyNow"
+                winC.kEventName = "Onbrd_EditPage_BuyNow"
             } else {
-                winC?.kEventName = "Reading_InsertImage_BuyNow"
+                winC.kEventName = "Reading_InsertImage_BuyNow"
             }
-            winC?.showWindow(nil)
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         
@@ -1492,17 +1600,27 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
     }
     
     @objc func item_insertFromClipboard(sender: NSMenuItem?) {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            if self.kEventTag == 1 {
+//                winC.kEventName = "Onbrd_EditPage_BuyNow"
+//            } else {
+//                winC.kEventName = "Reading_InsertClipboard_BuyNow"
+//            }
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
             if self.kEventTag == 1 {
-                winC?.kEventName = "Onbrd_EditPage_BuyNow"
+                winC.kEventName = "Onbrd_EditPage_BuyNow"
             } else {
-                winC?.kEventName = "Reading_InsertClipboard_BuyNow"
+                winC.kEventName = "Reading_InsertClipboard_BuyNow"
             }
-            winC?.showWindow(nil)
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
-//        self.choosePositionWindow {[weak self] index in
             /// 插入位置
             var error: NSError?
             guard let document: CPDFDocument = self.openDocumentWithImageFromPasteboard(NSPasteboard.general, error: &error) else {
@@ -1514,25 +1632,34 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
             }
             let ips: Set<IndexPath> = [IndexPath(item: index, section: 0)]
             self.thumbnailView.collectionView.scrollToItems(at: ips, scrollPosition: .centeredVertically)
-//        }
     }
     
     @objc func item_insertFromScanner(sender: NSMenuItem?) {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            if self.kEventTag == 1 {
+//                winC.kEventName = "Onbrd_EditPage_BuyNow"
+//            } else {
+//                winC.kEventName = "Reading_InsertSacnner_BuyNow"
+//            }
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
             if self.kEventTag == 1 {
-                winC?.kEventName = "Onbrd_EditPage_BuyNow"
+                winC.kEventName = "Onbrd_EditPage_BuyNow"
             } else {
-                winC?.kEventName = "Reading_InsertSacnner_BuyNow"
+                winC.kEventName = "Reading_InsertSacnner_BuyNow"
             }
-            winC?.showWindow(nil)
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         
         let vc = KMDeviceBrowserWindowController.shared
         vc.type = .scanner
         vc.importScannerFileCallback = { [weak self](url: NSURL) -> Void in
-//            self?.choosePositionWindow {[weak self] index in
                 /// 插入位置
                 if let imag = NSImage(contentsOfFile: url.path! ) {
                     let index = (self?.getInsertIndex())! + 1
@@ -1544,7 +1671,6 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
                     let ips: Set<IndexPath> = [IndexPath(item: index, section: 0)]
                     self?.thumbnailView.collectionView.scrollToItems(at: ips, scrollPosition: .centeredVertically)
                 }
-//            }
             vc.close()
         }
         vc.showWindow(NSApp.mainWindow)
@@ -1596,14 +1722,25 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
     }
     
     func extractSelectPageItemAction() {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            if self.kEventTag == 1 {
+//                winC.kEventName = "Onbrd_EditPage_BuyNow"
+//            } else {
+//                winC.kEventName = "Reading_Extract_BuyNow"
+//            }
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
             if self.kEventTag == 1 {
-                winC?.kEventName = "Onbrd_EditPage_BuyNow"
+                winC.kEventName = "Onbrd_EditPage_BuyNow"
             } else {
-                winC?.kEventName = "Reading_Extract_BuyNow"
+                winC.kEventName = "Reading_Extract_BuyNow"
             }
-            winC?.showWindow(nil)
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         

+ 9 - 3
PDF Office/PDF Master/Class/PDFTools/PageEdit/Window/SplitWindowController.swift

@@ -157,10 +157,16 @@ class SplitWindowController: KMBaseWindowController {
     }
     
     @IBAction func buttonItemClicked_ByRange(_ sender: AnyObject) {
-        if !IAPProductsManager.default().isAvailableAllFunction() {
+//        if !IAPProductsManager.default().isAvailableAllFunction() {
+//            pageFromButton.state = .off
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return;
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
             pageFromButton.state = .off
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
-            return;
+            KMMemberInfo.shared.advancedFunctionUsage()
+            return
         }
 
         self.byFileButton.state = .off

+ 7 - 2
PDF Office/PDF Master/Class/PDFTools/Print/KMPrintWindowController.swift

@@ -186,8 +186,13 @@ extension KMPrintWindowController {
     
     static func showNewPrintWindowControll(inputDocument: CPDFDocument?, inputType: DataNavigationViewButtonActionType = .Print, inputPageRange: KMPrintPageRange, printType: KMPrintModelType = .size) {
         //订阅
-        if !IAPProductsManager.default().isAvailableAllFunction() && printType != .size {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if !IAPProductsManager.default().isAvailableAllFunction() && printType != .size {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false && printType != .size {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         

+ 34 - 10
PDF Office/PDF Master/Class/PDFTools/Print/PrintHelper/PrintManage/KMPDFPrintManageWindowController.m

@@ -11,7 +11,6 @@
 #import "KMPDFMultiplePrintWindowController.h"
 #import "KMPDFPosterPrintWindowController.h"
 #import "KMPDFBookletWindowController.h"
-#import "KMPurchaseCompareWindowController.h"
 //#import "NSWindowController_SKExtensions.h"
 
 //#import "KMBookletMaskView.h"
@@ -598,11 +597,19 @@ typedef NS_ENUM(NSUInteger, kPageSelectStyle) {
 //Poster
 - (IBAction)buttonItemClicked_Poster:(NSButton *)sender
 {
-    if (![IAPProductsManager defaultManager].isAvailableAllFunction) {
+//    if (![IAPProductsManager defaultManager].isAvailableAllFunction) {
+//        [self close];
+//        [[KMProductCompareWC shared] setOrientation:NO];
+//        NSWindowController *winC = [KMProductCompareWC shared];
+//        winC.kEventName = @"MenuBar_PrintPoster_BuyNow";
+//        [winC showWindow:nil];
+//        return;
+//    }
+    if (![KMMemberInfo shared].isMemberAllFunction) {
         [self close];
-        NSWindowController *winC = [KMPurchaseCompareWindowController sharedInstance];
+        NSWindowController *winC = [KMProductCompareWC shared];
         winC.kEventName = @"MenuBar_PrintPoster_BuyNow";
-        [winC showWindow:nil];
+        [[KMMemberInfo shared] advancedFunctionUsage];
         return;
     }
     
@@ -617,13 +624,22 @@ typedef NS_ENUM(NSUInteger, kPageSelectStyle) {
 //Multiple
 - (IBAction)buttonItemClicked_Multiple:(NSButton *)sender
 {
-    if (![IAPProductsManager defaultManager].isAvailableAllFunction) {
+//    if (![IAPProductsManager defaultManager].isAvailableAllFunction) {
+//        [self close];
+//        [[KMProductCompareWC shared] setOrientation:NO];
+//        NSWindowController *winC = [KMProductCompareWC shared];
+//        winC.kEventName = @"MenuBar_PrintMultiple_BuyNow";
+//        [winC showWindow:nil];
+//        return;
+//    }
+    if (![KMMemberInfo shared].isMemberAllFunction) {
         [self close];
-        NSWindowController *winC = [KMPurchaseCompareWindowController sharedInstance];
+        NSWindowController *winC = [KMProductCompareWC shared];
         winC.kEventName = @"MenuBar_PrintMultiple_BuyNow";
-        [winC showWindow:nil];
+        [[KMMemberInfo shared] advancedFunctionUsage];
         return;
     }
+
     [self close];
     _multipleVC = [[KMPDFMultiplePrintWindowController alloc] initWithPDFDocument:self.pdfDocument];
 //    [multipleVC beginSheetModalForWindow:[NSApp mainWindow] completionHandler:nil];
@@ -635,11 +651,19 @@ typedef NS_ENUM(NSUInteger, kPageSelectStyle) {
 //Booklet
 - (IBAction)buttonItemClicked_Booklet:(NSButton *)sender
 {
-    if (![IAPProductsManager defaultManager].isAvailableAllFunction) {
+//    if (![IAPProductsManager defaultManager].isAvailableAllFunction) {
+//        [self close];
+//        [[KMProductCompareWC shared] setOrientation:NO];
+//        NSWindowController *winC = [KMProductCompareWC shared];
+//        winC.kEventName = @"MenuBar_PrintBooklet_BuyNow";
+//        [winC showWindow:nil];
+//        return;
+//    }
+    if (![KMMemberInfo shared].isMemberAllFunction) {
         [self close];
-        NSWindowController *winC = [KMPurchaseCompareWindowController sharedInstance];
+        NSWindowController *winC = [KMProductCompareWC shared];
         winC.kEventName = @"MenuBar_PrintBooklet_BuyNow";
-        [winC showWindow:nil];
+        [[KMMemberInfo shared] advancedFunctionUsage];
         return;
     }
     

+ 11 - 9
PDF Office/PDF Master/Class/PDFTools/RemovePassword/New/View/KMRemovePasswordView.swift

@@ -52,11 +52,6 @@ class KMRemovePasswordView: KMBaseXibView {
 
 extension KMRemovePasswordView {
     @IBAction func batchButtonAction(_ sender: Any) {
-//        if !IAPProductsManager.default().isAvailableAllFunction(){
-//            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
-//            return
-//        }
-
         guard let callBack = batchAction else { return }
         
         callBack(self, files)
@@ -70,10 +65,17 @@ extension KMRemovePasswordView {
     
     
     @IBAction func removeButtonAction(_ sender: Any) {
-        if !IAPProductsManager.default().isAvailableAllFunction(){
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
-            winC?.kEventName = "Reading_RemoveSecurity_BuyNow"
-            winC?.showWindow(nil)
+//        if !IAPProductsManager.default().isAvailableAllFunction(){
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            winC.kEventName = "Reading_RemoveSecurity_BuyNow"
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
+            winC.kEventName = "Reading_RemoveSecurity_BuyNow"
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
 

+ 11 - 4
PDF Office/PDF Master/Class/PDFTools/RemovePassword/VC/KMBatchOperateRemovePasswordViewController.swift

@@ -120,10 +120,17 @@ class KMBatchOperateRemovePasswordViewController: KMBatchOperateBaseViewControll
         if self.files?.count ?? 0 < 1 {
             return;
         }
-        if !IAPProductsManager.default().isAvailableAllFunction(){
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
-            winC?.kEventName = "Onbrd_Security_BuyNow"
-            winC?.showWindow(nil)
+//        if !IAPProductsManager.default().isAvailableAllFunction(){
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            winC.kEventName = "Onbrd_Security_BuyNow"
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
+            winC.kEventName = "Onbrd_Security_BuyNow"
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         //MARK: 判断是否能用pro功能

+ 7 - 2
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListView.m

@@ -1651,8 +1651,13 @@ NSNotificationName const CPDFListViewDisplayModeChangeNotification = @"CPDFListV
         
         NSString *filePath = filePaths.firstObject;
         if ([supportArray containsObject:[filePath.pathExtension lowercaseString]]) {
-            if (![[IAPProductsManager defaultManager] isAvailableAllFunction]) {
-                [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
+//            if (![[IAPProductsManager defaultManager] isAvailableAllFunction]) {
+//                [[KMProductCompareWC shared] setOrientation:NO];
+//                [[KMProductCompareWC shared] showWindow:nil];
+//                return NO;
+//            }
+            if (![KMMemberInfo shared].isMemberAllFunction) {
+                [[KMMemberInfo shared] advancedFunctionUsage];
                 return NO;
             }
             if([[filePath.pathExtension lowercaseString] isEqual:@"pdf"]) {

+ 64 - 19
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController+Thumbnail.swift

@@ -322,8 +322,13 @@ extension KMLeftSideViewController {
 
 extension KMLeftSideViewController {
     @objc func cutPage(_ sender: AnyObject?) {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         self.tableView(self.thumbnailTableView, cutRowsWithIndexes: self.thumbnailTableView.selectedRowIndexes)
@@ -338,24 +343,39 @@ extension KMLeftSideViewController {
     }
     
     @objc func deletePage(_ sender: AnyObject?) {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         self.tableView(self.thumbnailTableView, deleteRowsWithIndexes: self.thumbnailTableView.selectedRowIndexes)
     }
     
     @objc func rotatePageMenuAction(_ sender: AnyObject?) {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         self.tableView(self.thumbnailTableView, rotateRowsWithIndexes: self.thumbnailTableView.selectedRowIndexes as NSIndexSet)
     }
     
     @objc func quickInsert(_ sender: AnyObject?) {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         let idx = self.thumbnailTableView.selectedRowIndexes.first ?? NSNotFound
@@ -373,8 +393,13 @@ extension KMLeftSideViewController {
     }
     
     @objc func insert(_ sender: AnyObject?) {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         guard let document = self.pdfDocument() else {
@@ -433,8 +458,13 @@ extension KMLeftSideViewController {
     }
     
     @objc func insertPDF(_ sender: AnyObject?) {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
                 
@@ -536,8 +566,13 @@ extension KMLeftSideViewController {
     }
     
     @objc func extractPage(_ sender: AnyObject?) {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         self.tableView(self.thumbnailTableView, extractRowsWithIndexes: self.thumbnailTableView.selectedRowIndexes)
@@ -548,11 +583,16 @@ extension KMLeftSideViewController {
     }
     
     @objc func displayPageSize(_ sender: AnyObject?) {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
-        
+
         self.isDisplayPageSize = !self.isDisplayPageSize
         KMDataManager.ud_set(self.isDisplayPageSize, forKey: Self.Key.thumbDisplayPageSizeKey)
         
@@ -562,8 +602,13 @@ extension KMLeftSideViewController {
     }
     
     @objc func sharePage(_ sender: AnyObject?) {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         

+ 28 - 8
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController.swift

@@ -899,8 +899,13 @@ extension KMLeftSideViewController: KMBotaTableViewDelegate {
     }
     
     func tableView(_ aTableView: NSTableView, pasteFromPasteboard pboard: NSPasteboard?) {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         
@@ -1488,8 +1493,13 @@ extension KMLeftSideViewController: NSTableViewDelegate, NSTableViewDataSource {
             self.layoutDocumentView()
             self.resetThumbnails()
         } else if pasteboard.availableType(from: [.fileURL]) != nil && tableView.isEqual(to: self.thumbnailTableView) {
-            if IAPProductsManager.default().isAvailableAllFunction() == false {
-                KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//            if IAPProductsManager.default().isAvailableAllFunction() == false {
+//                KMProductCompareWC.shared.orientation = false
+//                KMProductCompareWC.shared.showWindow(nil)
+//                return false
+//            }
+            if KMMemberInfo.shared.isMemberAllFunction == false {
+                KMMemberInfo.shared.advancedFunctionUsage()
                 return false
             }
 
@@ -1634,8 +1644,13 @@ extension KMLeftSideViewController: NSTableViewDelegate, NSTableViewDataSource {
     }
     
     @objc dynamic func tableView(_ aTableView: NSTableView, deleteRowsWithIndexes rowIndexes: IndexSet) {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         if aTableView.isEqual(to: self.snapshotTableView) {
@@ -1675,8 +1690,13 @@ extension KMLeftSideViewController: NSTableViewDelegate, NSTableViewDataSource {
     }
     
     func tableView(_ aTableView: NSTableView, copyRowsWithIndexes rowIndexes: IndexSet) {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         if aTableView.isEqual(to: self.thumbnailTableView) {

+ 77 - 27
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Thumbnail/Base/KMPDFThumbViewBaseController.swift

@@ -152,14 +152,25 @@ class KMPDFThumbViewBaseController: KMBaseViewController {
     // 插入文件事件
     
     public func insertFileAction() {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            if self.kEventTag == 1 {
+//                winC.kEventName = "Onbrd_EditPage_BuyNow"
+//            } else {
+//                winC.kEventName = "Reading_InsertPDF_BuyNow"
+//            }
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
             if self.kEventTag == 1 {
-                winC?.kEventName = "Onbrd_EditPage_BuyNow"
+                winC.kEventName = "Onbrd_EditPage_BuyNow"
             } else {
-                winC?.kEventName = "Reading_InsertPDF_BuyNow"
+                winC.kEventName = "Reading_InsertPDF_BuyNow"
             }
-            winC?.showWindow(nil)
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         
@@ -206,14 +217,25 @@ class KMPDFThumbViewBaseController: KMBaseViewController {
     // 插入空白页面事件
     
     public func insertBlankPageAction() {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            if self.kEventTag == 1 {
+//                winC.kEventName = "Onbrd_EditPage_BuyNow"
+//            } else {
+//                winC.kEventName = "Reading_InsertBlankPage_BuyNow"
+//            }
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
             if self.kEventTag == 1 {
-                winC?.kEventName = "Onbrd_EditPage_BuyNow"
+                winC.kEventName = "Onbrd_EditPage_BuyNow"
             } else {
-                winC?.kEventName = "Reading_InsertBlankPage_BuyNow"
+                winC.kEventName = "Reading_InsertBlankPage_BuyNow"
             }
-            winC?.showWindow(nil)
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         
@@ -267,8 +289,13 @@ class KMPDFThumbViewBaseController: KMBaseViewController {
     }
     
     public func cutAction() {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         
@@ -278,17 +305,28 @@ class KMPDFThumbViewBaseController: KMBaseViewController {
     }
     
     public func copyAction() {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            if self.kEventTag == 1 {
+//                winC.kEventName = "Onbrd_EditPage_BuyNow"
+//            } else {
+//                winC.kEventName = "Reading_Copy_BuyNow"
+//            }
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
             if self.kEventTag == 1 {
-                winC?.kEventName = "Onbrd_EditPage_BuyNow"
+                winC.kEventName = "Onbrd_EditPage_BuyNow"
             } else {
-                winC?.kEventName = "Reading_Copy_BuyNow"
+                winC.kEventName = "Reading_Copy_BuyNow"
             }
-            winC?.showWindow(nil)
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
-        
+
         let indexpaths = self.thumbnailView.selectionIndexPaths
         self._copyPages(indexpaths: indexpaths)
         self.copyAfter(indexpaths: indexpaths)
@@ -317,8 +355,13 @@ class KMPDFThumbViewBaseController: KMBaseViewController {
     }
     
     public func pasteAction() {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         
@@ -358,11 +401,13 @@ class KMPDFThumbViewBaseController: KMBaseViewController {
     
     // 提取 指定的item
     public func extractActionIndexpaths(indexpaths: Set<IndexPath>) {
-//        let pageIndexs = self.indexpathsToIndexs(indexpaths: indexpaths)
-//        var fileName = self.thumbnailView.document?.documentURL.deletingPathExtension().lastPathComponent
-//        fileName?.append(KMPageRangeTools.newParseSelectedIndexs(selectedIndex: pageIndexs.sorted()))
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         
@@ -391,8 +436,13 @@ class KMPDFThumbViewBaseController: KMBaseViewController {
     
     // 替换 特定的item
     public func replaceAction() {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         self.km_open_file_multi {  [unowned self] index, params in

+ 23 - 7
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMAnnotationSelectLinkViewController.swift

@@ -130,17 +130,33 @@ enum KMAnnotationLinkType: UInt {
             box.downCallback = { [weak self] downEntered, mouseBox, event in
                 guard let self = self else { return }
                 if downEntered {
-                    if !IAPProductsManager.default().isAvailableAllFunction() {
+//                    if !IAPProductsManager.default().isAvailableAllFunction() {
+//                        if mouseBox == self.linkUrlBox || mouseBox == self.linkEmailBox {
+//                            if mouseBox == self.linkUrlBox {
+//                                KMProductCompareWC.shared.orientation = false
+//                                let winC = KMProductCompareWC.shared
+//                                winC.kEventName = "Reading_WebsiteLink_BuyNow"
+//                            } else if mouseBox == self.linkEmailBox {
+//                                KMProductCompareWC.shared.orientation = false
+//                                let winC = KMProductCompareWC.shared
+//                                winC.kEventName = "Reading_EmailLink_BuyNow"
+//                            }
+//                            
+//                            KMProductCompareWC.shared.orientation = false
+//                            KMProductCompareWC.shared.showWindow(nil)
+//                            return
+//                        }
+//                    }
+                    if KMMemberInfo.shared.isMemberAllFunction == false {
                         if mouseBox == self.linkUrlBox || mouseBox == self.linkEmailBox {
                             if mouseBox == self.linkUrlBox {
-                                let winC = KMPurchaseCompareWindowController.sharedInstance()
-                                winC?.kEventName = "Reading_WebsiteLink_BuyNow"
+                                let winC = KMProductCompareWC.shared
+                                winC.kEventName = "Reading_WebsiteLink_BuyNow"
                             } else if mouseBox == self.linkEmailBox {
-                                let winC = KMPurchaseCompareWindowController.sharedInstance()
-                                winC?.kEventName = "Reading_EmailLink_BuyNow"
+                                let winC = KMProductCompareWC.shared
+                                winC.kEventName = "Reading_EmailLink_BuyNow"
                             }
-                            
-                            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+                            KMMemberInfo.shared.advancedFunctionUsage()
                             return
                         }
                     }

+ 7 - 2
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/PageDisplay/KMPageDisplayCustomThemesCollectionViewItem.swift

@@ -86,8 +86,13 @@ class KMPageDisplayCustomThemesCollectionViewItem: NSCollectionViewItem {
         itemCount = item
         themesBox.mouseDownCallback = { [weak self] downEntered in
             if downEntered {
-                if !IAPProductsManager.default().isAvailableAllFunction() {
-                    KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//                if !IAPProductsManager.default().isAvailableAllFunction() {
+//                    KMProductCompareWC.shared.orientation = false
+//                    KMProductCompareWC.shared.showWindow(nil)
+//                    return
+//                }
+                if KMMemberInfo.shared.isMemberAllFunction == false {
+                    KMMemberInfo.shared.advancedFunctionUsage()
                     return
                 }
                 

+ 24 - 8
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/PageDisplay/KMPageDisplayPropertiesViewController.swift

@@ -558,10 +558,17 @@ class KMPageDisplayPropertiesButton: NSButton {
 //        [[FMTrackEventManager manager] trackEvent:@"SubTbr_PageDisplay" withProperties:@{@"SubTbr_Btn":@"Btn_SubTbr_PageDisplay_ViewSetting_SplitView"}];
         FMTrackEventManager.defaultManager.trackEvent(event: "SubTbr_PageDisplay", withProperties: ["SubTbr_Btn": "Btn_SubTbr_PageDisplay_ViewSetting_SplitView"])
         
-        if sender.tag > 0 && IAPProductsManager.default().isAvailableAllFunction() == false {
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
-            winC?.kEventName = "Reading_SplitView_BuyNow"
-            winC?.showWindow(nil)
+//        if sender.tag > 0 && IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            winC.kEventName = "Reading_SplitView_BuyNow"
+//            winC.showWindow(nil)
+//            return
+//        }
+        if sender.tag > 0 && KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
+            winC.kEventName = "Reading_SplitView_BuyNow"
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         
@@ -758,11 +765,20 @@ extension KMPageDisplayPropertiesViewController: NSCollectionViewDelegate, NSCol
         FMTrackEventManager.defaultManager.trackEvent(event: "SubTbr_PageDisplay", withProperties: ["SubTbr_Btn": "Btn_SubTbr_PageDisplay_ViewSetting_Themes"])
         
         for indexPath in indexPathArr {
-            if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            if IAPProductsManager.default().isAvailableAllFunction() == false {
+//                if indexPath.item > 0 {
+//                    KMProductCompareWC.shared.orientation = false
+//                    let winC = KMProductCompareWC.shared
+//                    winC.kEventName = "Reading_Theme_BuyNow"
+//                    winC.showWindow(nil)
+//                    return
+//                }
+//            }
+            if KMMemberInfo.shared.isMemberAllFunction == false {
                 if indexPath.item > 0 {
-                    let winC = KMPurchaseCompareWindowController.sharedInstance()
-                    winC?.kEventName = "Reading_Theme_BuyNow"
-                    winC?.showWindow(nil)
+                    let winC = KMProductCompareWC.shared
+                    winC.kEventName = "Reading_Theme_BuyNow"
+                    KMMemberInfo.shared.advancedFunctionUsage()
                     return
                 }
             }

+ 7 - 2
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/PageDisplay/KMPageDisplayThemeCollectionViewItem.swift

@@ -40,8 +40,13 @@ class KMPageDisplayThemeCollectionViewItem: NSCollectionViewItem {
     }
     
     @IBAction func closeButtonAction(_ sender: Any) {
-        if !IAPProductsManager.default().isAvailableAllFunction() {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if !IAPProductsManager.default().isAvailableAllFunction() {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         if let callback = itemCallBack {

+ 16 - 4
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/Signature/KMSignatureAnnotationViewController.m

@@ -146,17 +146,29 @@ KMSigntureViewItemDelegate>
 }
 
 - (IBAction)insertSignatureButton_Click:(id)sender {
-    if (![[IAPProductsManager defaultManager] isAvailableAllFunction]) {
-        NSWindowController *winC = [KMPurchaseCompareWindowController sharedInstance];
+//    if (![[IAPProductsManager defaultManager] isAvailableAllFunction]) {
+//        [[KMProductCompareWC shared] setOrientation:NO];
+//        NSWindowController *winC = [KMProductCompareWC shared];
+//        if (self.kEventTag == 1) {
+//            winC.kEventName = @"Reading_FillSign_Signature_BuyNow";
+//        } else {
+//            winC.kEventName = @"Reading_Signature_BuyNow";
+//        }
+//        
+//        [winC showWindow:nil];
+//        return;
+//    }
+    if (![KMMemberInfo shared].isMemberAllFunction) {
+        NSWindowController *winC = [KMProductCompareWC shared];
         if (self.kEventTag == 1) {
             winC.kEventName = @"Reading_FillSign_Signature_BuyNow";
         } else {
             winC.kEventName = @"Reading_Signature_BuyNow";
         }
-        
-        [winC showWindow:nil];
+        [[KMMemberInfo shared] advancedFunctionUsage];
         return;
     }
+
     [self showSignatureWindow];
 }
 

+ 0 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/Signature/KMSignatureWindowController.m

@@ -8,7 +8,6 @@
 
 #import "KMSignatureWindowController.h"
 #import "NSImage+PDFListView.h"
-#import "KMPurchaseCompareWindowController.h"
 #import "NSMenu_SKExtensions.h"
 
 #import <PDF_Reader_Pro-Swift.h>

+ 29 - 10
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/StampList/KMAnnotationStampViewController.swift

@@ -287,10 +287,17 @@ let KMPDFDynamicStampNeedAuthorKey1 = "km_pdfview_dynamic_stamp_need_author"
         self.dynamicBoxNew?.downCallback = { [weak self] downEntered, mouseBox, event in
 //        dynamicBox.downCallback = { [weak self] downEntered, mouseBox, event in
             guard let blockSelf = self else { return }
-            if downEntered && !IAPProductsManager.default().isAvailableAllFunction() {
-                let winC = KMPurchaseCompareWindowController.sharedInstance()
-                winC?.kEventName = "Reading_DynamicStamp_BuyNow"
-                winC?.showWindow(nil)
+//            if downEntered && !IAPProductsManager.default().isAvailableAllFunction() {
+//                KMProductCompareWC.shared.orientation = false
+//                let winC = KMProductCompareWC.shared
+//                winC.kEventName = "Reading_DynamicStamp_BuyNow"
+//                winC.showWindow(nil)
+//                return
+//            }
+            if downEntered && KMMemberInfo.shared.isMemberAllFunction == false {
+                let winC = KMProductCompareWC.shared
+                winC.kEventName = "Reading_DynamicStamp_BuyNow"
+                KMMemberInfo.shared.advancedFunctionUsage()
                 return
             }
             if downEntered && (blockSelf.stampType != .dynamic) {
@@ -309,10 +316,17 @@ let KMPDFDynamicStampNeedAuthorKey1 = "km_pdfview_dynamic_stamp_need_author"
         self.customBoxNew?.downCallback = { [weak self] downEntered, mouseBox, event in
 //        customBox.downCallback = { [weak self] downEntered, mouseBox, event in
             guard let blockSelf = self else { return }
-            if downEntered && !IAPProductsManager.default().isAvailableAllFunction() {
-                let winC = KMPurchaseCompareWindowController.sharedInstance()
-                winC?.kEventName = "Reading_CustomStamp_BuyNow"
-                winC?.showWindow(nil)
+//            if downEntered && !IAPProductsManager.default().isAvailableAllFunction() {
+//                KMProductCompareWC.shared.orientation = false
+//                let winC = KMProductCompareWC.shared
+//                winC.kEventName = "Reading_CustomStamp_BuyNow"
+//                winC.showWindow(nil)
+//                return
+//            }
+            if downEntered && KMMemberInfo.shared.isMemberAllFunction == false {
+                let winC = KMProductCompareWC.shared
+                winC.kEventName = "Reading_CustomStamp_BuyNow"
+                KMMemberInfo.shared.advancedFunctionUsage()
                 return
             }
             if downEntered && (blockSelf.stampType != .custom) {
@@ -1024,8 +1038,13 @@ let KMPDFDynamicStampNeedAuthorKey1 = "km_pdfview_dynamic_stamp_need_author"
     }
     
     @IBAction func addButtonAction(_ sender: NSButton) {
-        if !IAPProductsManager.default().isAvailableAllFunction() {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if !IAPProductsManager.default().isAvailableAllFunction() {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         

+ 12 - 4
PDF Office/PDF Master/Class/PDFWindowController/TabWindowController/KMTabbingHintWindowController.swift

@@ -86,11 +86,19 @@ class KMTabbingHintWindowController: NSWindowController{
         self.reloadData()
     }
     @IBAction func buttonClicked_NewTabInWindowButton(_ sender: NSButton) {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            sender.state = NSControl.StateValue.off
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            winC.kEventName = "Reading_MultiTab_BuyNow"
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
             sender.state = NSControl.StateValue.off
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
-            winC?.kEventName = "Reading_MultiTab_BuyNow"
-            winC?.showWindow(nil)
+            let winC = KMProductCompareWC.shared
+            winC.kEventName = "Reading_MultiTab_BuyNow"
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         sender.state = NSControl.StateValue.on

+ 12 - 4
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarViewController.swift

@@ -235,11 +235,19 @@ class KMToolbarViewController: NSViewController, NSTextFieldDelegate {
     @IBAction func leftControllButtonAction(item: KMToolbarClickButton) {
         let tag = KMToolbarViewType(rawValue: item.tag) ?? .None
         if tag == .editPDF {
-            if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            if IAPProductsManager.default().isAvailableAllFunction() == false {
+//                KMPreference.shared.openDocumentType = .newWindow
+//                KMProductCompareWC.shared.orientation = false
+//                let winC = KMProductCompareWC.shared
+//                winC.kEventName = "Reading_EditPDF_BuyNow"
+//                winC.showWindow(nil)
+//                return
+//            }
+            if KMMemberInfo.shared.isMemberAllFunction == false {
                 KMPreference.shared.openDocumentType = .newWindow
-                let winC = KMPurchaseCompareWindowController.sharedInstance()
-                winC?.kEventName = "Reading_EditPDF_BuyNow"
-                winC?.showWindow(nil)
+                let winC = KMProductCompareWC.shared
+                winC.kEventName = "Reading_EditPDF_BuyNow"
+                KMMemberInfo.shared.advancedFunctionUsage()
                 return
             }
             let allowsPrinting = self.pdfView?.document?.allowsPrinting ?? false

+ 163 - 56
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift

@@ -1254,8 +1254,13 @@ extension KMMainViewController {
         Task { @MainActor in
             let idx = sender.tag
             if idx == 10 {
-                if IAPProductsManager.default().isAvailableAllFunction() == false {
-                    KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//                if IAPProductsManager.default().isAvailableAllFunction() == false {
+//                    KMProductCompareWC.shared.orientation = false
+//                    KMProductCompareWC.shared.showWindow(nil)
+//                    return
+//                }
+                if KMMemberInfo.shared.isMemberAllFunction == false {
+                    KMMemberInfo.shared.advancedFunctionUsage()
                     return
                 }
             }
@@ -3037,15 +3042,27 @@ extension KMMainViewController {
     
     //MARK: 转档 - OCR
     func showOCRWindow() {
-        if !IAPProductsManager.default().isAvailableAllFunction(){
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
+//        if !IAPProductsManager.default().isAvailableAllFunction(){
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            let type = self.toolbarController.toolbarType ?? .None
+//            if type == .Conversion {
+//                winC.kEventName = "Reading_Convert_OCR_BuyNow"
+//            } else {
+//                winC.kEventName = "Reading_OCR_BuyNow"
+//            }
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
             let type = self.toolbarController.toolbarType ?? .None
             if type == .Conversion {
-                winC?.kEventName = "Reading_Convert_OCR_BuyNow"
+                winC.kEventName = "Reading_Convert_OCR_BuyNow"
             } else {
-                winC?.kEventName = "Reading_OCR_BuyNow"
+                winC.kEventName = "Reading_OCR_BuyNow"
             }
-            winC?.showWindow(nil)
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         let com = KMOCRPDFWindowController(cpdfDocument: self.listView.document!, pwd: self.listView.document?.password ?? "")
@@ -3055,10 +3072,17 @@ extension KMMainViewController {
     
     //MARK: 导出图片
     func extractImageAction(num: Int) {
-        if !IAPProductsManager.default().isAvailableAllFunction(){
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
-            winC?.kEventName = "Reading_ExtractImage_BuyNow"
-            winC?.showWindow(nil)
+//        if !IAPProductsManager.default().isAvailableAllFunction(){
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            winC.kEventName = "Reading_ExtractImage_BuyNow"
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
+            winC.kEventName = "Reading_ExtractImage_BuyNow"
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         
@@ -3069,10 +3093,6 @@ extension KMMainViewController {
             alert.runModal()
             return
         }
-        //        if sender is KMToolbarItem {
-        //            (sender as! KMToolbarItem).isSelected = false
-        //        }
-
         
         let document = self.listView.document
         var fileURL = document?.documentURL
@@ -3221,10 +3241,16 @@ extension KMMainViewController {
         FMTrackEventManager.defaultManager.trackEvent(event: "SubTbr_Tools", withProperties: ["SubTbr_Btn": "Btn_SubTbr_Tools_Image"])
         
         changeAnnotationMode(sender)
-        guard IAPProductsManager.default().isAvailableAllFunction() else {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        guard IAPProductsManager.default().isAvailableAllFunction() else {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        guard KMMemberInfo.shared.isMemberAllFunction else {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
+
         
         let accessoryCtr = KMImageAccessoryController()
         let openPanel = NSOpenPanel()
@@ -3287,10 +3313,17 @@ extension KMMainViewController {
     @IBAction func tableAnnotation(_ sender: Any) {
         FMTrackEventManager.defaultManager.trackEvent(event: "SubTbr_Tools", withProperties: ["SubTbr_Btn": "Btn_SubTbr_Tools_Table"])
         changeAnnotationMode(sender)
-        guard IAPProductsManager.default().isAvailableAllFunction() else {
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
-            winC?.kEventName = "Reading_Table_BuyNow"
-            winC?.showWindow(nil)
+//        guard IAPProductsManager.default().isAvailableAllFunction() else {
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            winC.kEventName = "Reading_Table_BuyNow"
+//            winC.showWindow(nil)
+//            return
+//        }
+        guard KMMemberInfo.shared.isMemberAllFunction else {
+            let winC = KMProductCompareWC.shared
+            winC.kEventName = "Reading_Table_BuyNow"
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         listView.addAnnotationWithTable()
@@ -3786,10 +3819,17 @@ extension KMMainViewController : KMToolbarViewControllerDelegate {
     }
     
     func toolbarViewController(_ viewController: KMToolbarViewController, shareFlatten item: NSMenuItem) {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
-            winC?.kEventName = "Reading_Flatten_BuyNow"
-            winC?.showWindow(nil)
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            winC.kEventName = "Reading_Flatten_BuyNow"
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
+            winC.kEventName = "Reading_Flatten_BuyNow"
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         self.shareFlatten(sender: viewController)
@@ -3965,22 +4005,41 @@ extension KMMainViewController : KMToolbarViewControllerDelegate {
             
             if (type == .bates || type == .headerAndFooter) {
                 
-                if !IAPProductsManager.default().isAvailableAllFunction(){
-                    let winC = KMPurchaseCompareWindowController.sharedInstance()
+//                if !IAPProductsManager.default().isAvailableAllFunction(){
+//                    KMProductCompareWC.shared.orientation = false
+//                    let winC = KMProductCompareWC.shared
+//                    if type == .headerAndFooter {
+//                        if index == 1 {
+//                            winC.kEventName = "Reading_AddHeaderFooter_BuyNow"
+//                        } else if index == 2 {
+//                            winC.kEventName = "Reading_RemoveHeaderFooter_BuyNow"
+//                        }
+//                    } else if type == .bates {
+//                        if index == 1 {
+//                            winC.kEventName = "Reading_AddBates_BuyNow"
+//                        } else if index == 2 {
+//                            winC.kEventName = "Reading_RemoveBates_BuyNow"
+//                        }
+//                    }
+//                    winC.showWindow(nil)
+//                    return
+//                }
+                if KMMemberInfo.shared.isMemberAllFunction == false {
+                    let winC = KMProductCompareWC.shared
                     if type == .headerAndFooter {
                         if index == 1 {
-                            winC?.kEventName = "Reading_AddHeaderFooter_BuyNow"
+                            winC.kEventName = "Reading_AddHeaderFooter_BuyNow"
                         } else if index == 2 {
-                            winC?.kEventName = "Reading_RemoveHeaderFooter_BuyNow"
+                            winC.kEventName = "Reading_RemoveHeaderFooter_BuyNow"
                         }
                     } else if type == .bates {
                         if index == 1 {
-                            winC?.kEventName = "Reading_AddBates_BuyNow"
+                            winC.kEventName = "Reading_AddBates_BuyNow"
                         } else if index == 2 {
-                            winC?.kEventName = "Reading_RemoveBates_BuyNow"
+                            winC.kEventName = "Reading_RemoveBates_BuyNow"
                         }
                     }
-                    winC?.showWindow(nil)
+                    KMMemberInfo.shared.advancedFunctionUsage()
                     return
                 }
                 
@@ -4135,8 +4194,13 @@ extension KMMainViewController : KMToolbarViewControllerDelegate {
                     self.openRightPane()
                 }
             } else if (type == .redact) { /// 标记密文
-                if !IAPProductsManager.default().isAvailableAllFunction(){
-                    KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//                if !IAPProductsManager.default().isAvailableAllFunction(){
+//                    KMProductCompareWC.shared.orientation = false
+//                    KMProductCompareWC.shared.showWindow(nil)
+//                    return
+//                }
+                if KMMemberInfo.shared.isMemberAllFunction == false {
+                    KMMemberInfo.shared.advancedFunctionUsage()
                     return
                 }
                 
@@ -4346,10 +4410,17 @@ extension KMMainViewController : KMToolbarViewControllerDelegate {
                 }
             } else if type == .comparison {
                 FMTrackEventManager.defaultManager.trackEvent(event: "SubTbr_Editor", withProperties: ["SubTbr_Btn": "Btn_SubTbr_Editor_Compare"])
-                if !IAPProductsManager.default().isAvailableAllFunction(){
-                    let winC = KMPurchaseCompareWindowController.sharedInstance()
-                    winC?.kEventName = "Reading_Compare_BuyNow"
-                    winC?.showWindow(nil)
+//                if !IAPProductsManager.default().isAvailableAllFunction(){
+//                    KMProductCompareWC.shared.orientation = false
+//                    let winC = KMProductCompareWC.shared
+//                    winC.kEventName = "Reading_Compare_BuyNow"
+//                    winC.showWindow(nil)
+//                    return
+//                }
+                if KMMemberInfo.shared.isMemberAllFunction == false {
+                    let winC = KMProductCompareWC.shared
+                    winC.kEventName = "Reading_Compare_BuyNow"
+                    KMMemberInfo.shared.advancedFunctionUsage()
                     return
                 }
                 
@@ -4385,14 +4456,25 @@ extension KMMainViewController : KMToolbarViewControllerDelegate {
             
                 await NSWindow.currentWindow().beginSheet(controller.window!)
             } else if type == .watermark {
-                if !IAPProductsManager.default().isAvailableAllFunction(){
-                    let winC = KMPurchaseCompareWindowController.sharedInstance()
+//                if !IAPProductsManager.default().isAvailableAllFunction(){
+//                    KMProductCompareWC.shared.orientation = false
+//                    let winC = KMProductCompareWC.shared
+//                    if index == 1 {
+//                        winC.kEventName = "Reading_AddWatermark_BuyNow"
+//                    } else if index == 2 {
+//                        winC.kEventName = "Reading_RemoveWatermark_BuyNow"
+//                    }
+//                    winC.showWindow(nil)
+//                    return
+//                }
+                if KMMemberInfo.shared.isMemberAllFunction == false {
+                    let winC = KMProductCompareWC.shared
                     if index == 1 {
-                        winC?.kEventName = "Reading_AddWatermark_BuyNow"
+                        winC.kEventName = "Reading_AddWatermark_BuyNow"
                     } else if index == 2 {
-                        winC?.kEventName = "Reading_RemoveWatermark_BuyNow"
+                        winC.kEventName = "Reading_RemoveWatermark_BuyNow"
                     }
-                    winC?.showWindow(nil)
+                    KMMemberInfo.shared.advancedFunctionUsage()
                     return
                 }
                 
@@ -4495,14 +4577,25 @@ extension KMMainViewController : KMToolbarViewControllerDelegate {
                     return
                 }
             } else if type == .background {
-                if !IAPProductsManager.default().isAvailableAllFunction(){
-                    let winC = KMPurchaseCompareWindowController.sharedInstance()
+//                if !IAPProductsManager.default().isAvailableAllFunction(){
+//                    KMProductCompareWC.shared.orientation = false
+//                    let winC = KMProductCompareWC.shared
+//                    if index == 1 {
+//                        winC.kEventName = "Reading_AddBackground_BuyNow"
+//                    } else if index == 2 {
+//                        winC.kEventName = "Reading_RemoveBackground_BuyNow"
+//                    }
+//                    winC.showWindow(nil)
+//                    return
+//                }
+                if KMMemberInfo.shared.isMemberAllFunction == false {
+                    let winC = KMProductCompareWC.shared
                     if index == 1 {
-                        winC?.kEventName = "Reading_AddBackground_BuyNow"
+                        winC.kEventName = "Reading_AddBackground_BuyNow"
                     } else if index == 2 {
-                        winC?.kEventName = "Reading_RemoveBackground_BuyNow"
+                        winC.kEventName = "Reading_RemoveBackground_BuyNow"
                     }
-                    winC?.showWindow(nil)
+                    KMMemberInfo.shared.advancedFunctionUsage()
                     return
                 }
                 
@@ -4576,10 +4669,17 @@ extension KMMainViewController : KMToolbarViewControllerDelegate {
                     return
                 }
             } else if type == .measure {
-                if !IAPProductsManager.default().isAvailableAllFunction(){
-                    let winC = KMPurchaseCompareWindowController.sharedInstance()
-                    winC?.kEventName = "Reading_Measure_BuyNow"
-                    winC?.showWindow(nil)
+//                if !IAPProductsManager.default().isAvailableAllFunction(){
+//                    KMProductCompareWC.shared.orientation = false
+//                    let winC = KMProductCompareWC.shared
+//                    winC.kEventName = "Reading_Measure_BuyNow"
+//                    winC.showWindow(nil)
+//                    return
+//                }
+                if KMMemberInfo.shared.isMemberAllFunction == false {
+                    let winC = KMProductCompareWC.shared
+                    winC.kEventName = "Reading_Measure_BuyNow"
+                    KMMemberInfo.shared.advancedFunctionUsage()
                     return
                 }
                 
@@ -5047,10 +5147,17 @@ extension KMMainViewController : KMToolbarViewControllerDelegate {
                 
                 winC.startModal(nil)
             } else if index == 12 {
-                if IAPProductsManager.default().isAvailableAllFunction() == false {
-                    let winC = KMPurchaseCompareWindowController.sharedInstance()
-                    winC?.kEventName = "Reading_ReplaceText_BuyNow"
-                    winC?.showWindow(nil)
+//                if IAPProductsManager.default().isAvailableAllFunction() == false {
+//                    KMProductCompareWC.shared.orientation = false
+//                    let winC = KMProductCompareWC.shared
+//                    winC.kEventName = "Reading_ReplaceText_BuyNow"
+//                    winC.showWindow(nil)
+//                    return
+//                }
+                if KMMemberInfo.shared.isMemberAllFunction == false {
+                    let winC = KMProductCompareWC.shared
+                    winC.kEventName = "Reading_ReplaceText_BuyNow"
+                    KMMemberInfo.shared.advancedFunctionUsage()
                     return
                 }
                 

+ 61 - 20
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+MenuAction.swift

@@ -95,8 +95,13 @@ extension KMMainViewController: KMSystemFileMenuProtocol {
     
     @IBAction func menuItemClick_saveAsFlattenedPDF(_ sender: Any) {
         Task { @MainActor in
-            if IAPProductsManager.default().isAvailableAllFunction() == false {
-                KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//            if IAPProductsManager.default().isAvailableAllFunction() == false {
+//                KMProductCompareWC.shared.orientation = false
+//                KMProductCompareWC.shared.showWindow(nil)
+//                return
+//            }
+            if KMMemberInfo.shared.isMemberAllFunction == false {
+                KMMemberInfo.shared.advancedFunctionUsage()
                 return
             }
             self.saveAsFlattenedPDFAction()
@@ -393,8 +398,13 @@ extension KMMainViewController {
             return
         }
 
-        if item.tag < 2 && IAPProductsManager.default().isAvailableAllFunction() == false {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if item.tag < 2 && IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if item.tag < 2 && KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         self.splitView(withTag: item.tag)
@@ -407,8 +417,13 @@ extension KMMainViewController {
         }
         let mode = item.tag
         if mode > 0 {
-            if !IAPProductsManager.default().isAvailableAllFunction() {
-                KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//            if !IAPProductsManager.default().isAvailableAllFunction() {
+//                KMProductCompareWC.shared.orientation = false
+//                KMProductCompareWC.shared.showWindow(nil)
+//                return
+//            }
+            if KMMemberInfo.shared.isMemberAllFunction == false {
+                KMMemberInfo.shared.advancedFunctionUsage()
                 return
             }
         }
@@ -1218,11 +1233,19 @@ extension KMMainViewController: KMSystemToolMenuProtocol {
     }
     
     func rotateLeft(_ sender: Any?) {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
-            winC?.kEventName = "Reading_Rotate_BuyNow"
-            winC?.kEventTag = 1
-            winC?.showWindow(nil)
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            winC.kEventName = "Reading_Rotate_BuyNow"
+//            winC.kEventTag = 1
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
+            winC.kEventName = "Reading_Rotate_BuyNow"
+            winC.kEventTag = 1
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         
@@ -1237,11 +1260,19 @@ extension KMMainViewController: KMSystemToolMenuProtocol {
     }
     
     func rotateRight(_ sender: Any?) {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
-            winC?.kEventName = "Reading_Rotate_BuyNow"
-            winC?.kEventTag = 1
-            winC?.showWindow(nil)
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            winC.kEventName = "Reading_Rotate_BuyNow"
+//            winC.kEventTag = 1
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
+            winC.kEventName = "Reading_Rotate_BuyNow"
+            winC.kEventTag = 1
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         
@@ -1256,8 +1287,13 @@ extension KMMainViewController: KMSystemToolMenuProtocol {
     }
     
     func rotateAllLeft(_ sender: Any?) {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         
@@ -1276,8 +1312,13 @@ extension KMMainViewController: KMSystemToolMenuProtocol {
     }
     
     func rotateAllRight(_ sender: Any?) {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//        if IAPProductsManager.default().isAvailableAllFunction() == false {
+//            KMProductCompareWC.shared.orientation = false
+//            KMProductCompareWC.shared.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
         

+ 41 - 13
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+UI.swift

@@ -306,33 +306,61 @@ extension KMMainViewController: KMToolbarControllerDelegate {
     
     func changeAnnotationModeAction(item: KMToolbarClickButton) {
         if self.listView.toolMode == .formToolMode {
-            if !IAPProductsManager.default().isAvailableAllFunction(){
-                let winC = KMPurchaseCompareWindowController.sharedInstance()
+//            if !IAPProductsManager.default().isAvailableAllFunction(){
+//                KMProductCompareWC.shared.orientation = false
+//                let winC = KMProductCompareWC.shared
+//                if let type = CAnnotationType(rawValue: item.tag) {
+//                    if type == .textField {
+//                        winC.kEventName = "Reading_TextField_BuyNow"
+//                    } else if type == .checkBox {
+//                        winC.kEventName = "Reading_CheckBox_BuyNow"
+//                    } else if type == .radioButton {
+//                        winC.kEventName = "Reading_RadioButton_BuyNow"
+//                    } else if type == .listMenu {
+//                        winC.kEventName = "Reading_ListBox_BuyNow"
+//                    } else if type == .comboBox {
+//                        winC.kEventName = "Reading_ComboBox_BuyNow"
+//                    } else if type == .actionButton {
+//                        winC.kEventName = "Reading_Button_BuyNow"
+//                    }
+//                }
+//                winC.showWindow(nil)
+//                return
+//            }
+            if KMMemberInfo.shared.isMemberAllFunction == false {
+                let winC = KMProductCompareWC.shared
                 if let type = CAnnotationType(rawValue: item.tag) {
                     if type == .textField {
-                        winC?.kEventName = "Reading_TextField_BuyNow"
+                        winC.kEventName = "Reading_TextField_BuyNow"
                     } else if type == .checkBox {
-                        winC?.kEventName = "Reading_CheckBox_BuyNow"
+                        winC.kEventName = "Reading_CheckBox_BuyNow"
                     } else if type == .radioButton {
-                        winC?.kEventName = "Reading_RadioButton_BuyNow"
+                        winC.kEventName = "Reading_RadioButton_BuyNow"
                     } else if type == .listMenu {
-                        winC?.kEventName = "Reading_ListBox_BuyNow"
+                        winC.kEventName = "Reading_ListBox_BuyNow"
                     } else if type == .comboBox {
-                        winC?.kEventName = "Reading_ComboBox_BuyNow"
+                        winC.kEventName = "Reading_ComboBox_BuyNow"
                     } else if type == .actionButton {
-                        winC?.kEventName = "Reading_Button_BuyNow"
+                        winC.kEventName = "Reading_Button_BuyNow"
                     }
                 }
-                winC?.showWindow(nil)
+                KMMemberInfo.shared.advancedFunctionUsage()
                 return
             }
         } else {
             let type = CAnnotationType(rawValue: item.tag) ?? CAnnotationType.unkown
             if type == .signature {
-                if !IAPProductsManager.default().isAvailableAllFunction(){
-                    let winC = KMPurchaseCompareWindowController.sharedInstance()
-                    winC?.kEventName = "Reading_ElectronicSign_BuyNow"
-                    winC?.showWindow(nil)
+//                if !IAPProductsManager.default().isAvailableAllFunction(){
+//                    KMProductCompareWC.shared.orientation = false
+//                    let winC = KMProductCompareWC.shared
+//                    winC.kEventName = "Reading_ElectronicSign_BuyNow"
+//                    winC.showWindow(nil)
+//                    return
+//                }
+                if KMMemberInfo.shared.isMemberAllFunction == false {
+                    let winC = KMProductCompareWC.shared
+                    winC.kEventName = "Reading_ElectronicSign_BuyNow"
+                    KMMemberInfo.shared.advancedFunctionUsage()
                     return
                 }
             }

+ 43 - 16
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift

@@ -702,13 +702,20 @@ import Cocoa
     // MARK: - 标记密文
     
     func enterRedact() {
-        if !IAPProductsManager.default().isAvailableAllFunction(){
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
-            winC?.kEventName = "Reading_Redact_BuyNow"
-            winC?.showWindow(nil)
+//        if !IAPProductsManager.default().isAvailableAllFunction(){
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            winC.kEventName = "Reading_Redact_BuyNow"
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
+            winC.kEventName = "Reading_Redact_BuyNow"
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
-        
+
         if self.listView.document?.allowsPrinting == false || self.listView.document?.allowsCopying == false {
             Task {
                 _ = await KMAlertTool.runModel(message: KMLocalizedString("This is a secured document. Editing is not permitted.", nil))
@@ -1041,18 +1048,30 @@ import Cocoa
                             limitWC.showWindow(nil)
                         }
                     } else {
-                        KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+                        KMProductCompareWC.shared.orientation = false
+                        KMProductCompareWC.shared.showWindow(nil)
                     }
 #else
-                    if IAPProductsManager.default().isAvailableAllFunction() {
-                        if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
-                            //Convert:
+//                    if IAPProductsManager.default().isAvailableAllFunction() {
+//                        if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+//                            //Convert:
+//                        } else {
+//                            var vc = KMToolCompareWindowController(toolType: .Convert, selectNum: 1)
+//                            vc.showWindow(nil)
+//                        }
+//                    } else {
+//                        KMProductCompareWC.shared.orientation = false
+//                        KMProductCompareWC.shared.showWindow(nil)
+//                    }
+                    if KMMemberInfo.shared.isMemberAllFunction == true {
+                        if KMMemberInfo.shared.isPermitConvert == true {
+                            
                         } else {
                             var vc = KMToolCompareWindowController(toolType: .Convert, selectNum: 1)
                             vc.showWindow(nil)
                         }
                     } else {
-                        KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+                        KMMemberInfo.shared.advancedFunctionUsage()
                     }
 #endif
                 }
@@ -1080,7 +1099,8 @@ import Cocoa
             if lastVersion.isEmpty || lastVersion != appVersion {
                 UserDefaults.standard.setValue(appVersion, forKey: "SKLastTrialVersionMainDocumentLaunchedKey")
                 UserDefaults.standard.synchronize()
-                KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+                KMProductCompareWC.shared.orientation = false
+                KMProductCompareWC.shared.showWindow(nil)
             }
         }
 #endif
@@ -1257,13 +1277,20 @@ import Cocoa
     }
     
     func showDigitalSignWindow(withFilePathURL fileURL: URL) {
-        if !IAPProductsManager.default().isAvailableAllFunction(){
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
-            winC?.kEventName = "Reading_DigitalSign_BuyNow"
-            winC?.showWindow(nil)
+//        if !IAPProductsManager.default().isAvailableAllFunction(){
+//            KMProductCompareWC.shared.orientation = false
+//            let winC = KMProductCompareWC.shared
+//            winC.kEventName = "Reading_DigitalSign_BuyNow"
+//            winC.showWindow(nil)
+//            return
+//        }
+        if KMMemberInfo.shared.isMemberAllFunction == false {
+            let winC = KMProductCompareWC.shared
+            winC.kEventName = "Reading_DigitalSign_BuyNow"
+            KMMemberInfo.shared.advancedFunctionUsage()
             return
         }
-        
+
         if hasShowDigitalSign() {
             self.exitDigitalSign()
         }

+ 9 - 3
PDF Office/PDF Master/Class/Preference/Controller/KMGeneralPreferences.swift

@@ -188,9 +188,15 @@ class KMGeneralPreferences: NSViewController {
         var tabbingMode = NSWindow.TabbingMode.automatic
         if (self.openTabButton.indexOfSelectedItem == 0) {
 #if VERSION_FREE
-            if IAPProductsManager.default().isAvailableAllFunction() == false {
-                KMPreference.shared.openDocumentType = .newWindow
-                KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//            if IAPProductsManager.default().isAvailableAllFunction() == false {
+//                KMPreference.shared.openDocumentType = .newWindow
+//                KMProductCompareWC.shared.orientation = false
+//                KMProductCompareWC.shared.showWindow(nil)
+//                self.openTabButton.selectItem(at: 1)
+//                return
+//            }
+            if KMMemberInfo.shared.isMemberAllFunction == false {
+                KMMemberInfo.shared.advancedFunctionUsage()
                 self.openTabButton.selectItem(at: 1)
                 return
             }

+ 6 - 67
PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseCompareDMGWindowController.m

@@ -7,21 +7,8 @@
 
 #import "KMPurchaseCompareDMGWindowController.h"
 #import <PDF_Reader_Pro-Swift.h>
-
-//#import "HyperLinkButton.h"
-
 #import "KMVerificationWindowController.h"
-//#import "KMPurchaseCompareWindowController.h"
 #import "VerificationManager.h"
-//#import "GAIManager.h"
-//#import "NSImage_SKExtensions.h"
-//#import "KMButton.h"
-//#import "KMBox.h"
-//#import "SKInspectPublicTool.h"
-//#import "FMTrackEventManager.h"
-//#import "NSFont+Custom.h"
-//#import "KMToolbarItemPopViewController.h"
-//#import "KMRecommondManager.h"
 
 static NSString *const KMPurchaseCompareDMGHeaderCellIdentifier = @"KMPurchaseCompareDMGHeaderCell";
 static NSString *const KMPurchaseCompareDMGCellIdentifier       = @"KMPurchaseCompareDMGCell";
@@ -687,60 +674,18 @@ static NSString *const KMPurchaseCompareDMGCellIdentifier       = @"KMPurchaseCo
 }
 
 - (IBAction)enterLicenseAction:(id)sender {
-//    if (ActivityStatusNone == [VerificationManager manager].status) {
-//        [self close];
-//        KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivate];
-//        vc.callback = ^{
-//            [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
-//        };
-//        [vc showWindow:nil];
-//    } else if (ActivityStatusTrialExpire == [VerificationManager manager].status) {
-//        if ([VerificationManager manager].secondTrialEnabled) {
-//            [[FMTrackEventManager manager] trackEvent:@"Tbr" withProperties:@{@"Tbr_Btn":@"Btn_Tbr_SecondTrial"}];
-//            [[VerificationManager manager] trialForDays:7
-//                                                  email:[VerificationManager manager].email
-//                                                   name:[VerificationManager manager].accountName
-//                                            complention:^(ActivityStatus status, NSDictionary *info, NSError *error) {
-//                if (error ||
-//                    status != ActivityStatusTrial) {
-//                    NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Activation Error", nil)
-//                                                     defaultButton:NSLocalizedString(@"Try Again", nil)
-//                                                   alternateButton:nil
-//                                                       otherButton:nil
-//                                         informativeTextWithFormat:NSLocalizedString(@"Failed to sign up for the free trial. Please make sure your internet connection is available and try again later.", nil), nil];
-//                    [alert runModal];
-//                } else {
-//                    KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeRepeatTrialSuccess];
-//                    [vc showWindow:nil];
-//                }
-//            }];
-//            [self close];
-//        } else {
-//            [self close];
-//            KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivate];
-//            vc.callback = ^{
-//                [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
-//            };
-//            [vc showWindow:nil];
-//        }
-//    } else {
         [self close];
         KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivate];
         vc.callback = ^{
-            [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
+//            [[KMProductCompareWC shared] setOrientation:NO];
+//            [[KMProductCompareWC shared] showWindow:nil];
+            [[KMMemberInfo shared] advancedFunctionUsage];
         };
         [vc showWindow:nil];
-//    }
 
 }
 
 - (IBAction)buttonItemClicked_Buy:(id)sender {
-//#if VERSION_DMG
-//    NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@?utm_source=app_dmg&utm_medium=dmg_puw_comparison", Swift_oc_Tool.Store_Link_OC]];
-//    [[NSWorkspace sharedWorkspace] openURL:url];
-//    [[FMTrackEventManager defaultManager] trackEventWithEvent:@"PUW" withProperties:@{@"PUW_Btn":@"PUW_Btn_UpgradeBuyNow"}];
-//#endif
-    
 #if VERSION_DMG
     [self trackEvent_buyNow];
     NSString *paidEventName = [self _buyNowEventToPaidEventName];
@@ -807,18 +752,12 @@ static NSString *const KMPurchaseCompareDMGCellIdentifier       = @"KMPurchaseCo
             [self close];
             KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeTrial];
             vc.callback = ^{
-                [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
+//                [[KMProductCompareWC shared] setOrientation:NO];
+//                [[KMProductCompareWC shared] showWindow:nil];
+                [[KMMemberInfo shared] advancedFunctionUsage];
             };
             [vc showWindow:nil];
         }
-//    } else {
-//        [self close];
-//        KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivate];
-//        vc.callback = ^{
-//            [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
-//        };
-//        [vc showWindow:nil];
-//    }
 }
 
 - (IBAction)aiPurchaseButtonClick:(NSButton *)sender {

+ 318 - 168
PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationMessageViewController.m

@@ -10,11 +10,7 @@
 #import "VerificationManager.h"
 #import "AIInfoManager.h"
 #import "KMVerificationWindowController.h"
-#import "KMPurchaseCompareWindowController.h"
 #import "KMUnlockAlertViewController.h"
-//#import "FMTrackEventManager.h"
-//#import "SKInspectPublicTool.h"
-//#import "KMToolCompareWindowController.h"
 
 #define kbottomGap 0
 @interface KMVerificationMessageViewController ()<
@@ -32,6 +28,10 @@ NSPopoverDelegate>
 
 @property (weak) IBOutlet NSButton *userButton;
 
+@property (assign) IBOutlet NSView *signUpView;
+@property (assign) IBOutlet NSImageView *signUpImg;
+@property (assign) IBOutlet NSTextField *signUpLabel;
+
 @property (nonatomic, retain) NSTrackingArea *trackingArea;
 
 @property (nonatomic, retain) NSPopover *popover;
@@ -128,6 +128,12 @@ NSPopoverDelegate>
     self.aiLabel.textColor = [NSColor whiteColor];
     
     [self reloadData];
+    
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(popoverShowNoti:) name:@"KMVerificationMessagePopShowNoti" object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loginSuccessNotification:) name:@"MemberCenterLoginSuccess" object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(logoutSuccessNotification:) name:@"MemberCenterLogoutSuccess" object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(expandPersonalCenterNotification:) name:@"ExpandPersonalCenter" object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(closeMenu:) name:@"CloseMenuNotification" object:nil];
 }
 
 - (void)reloadData {
@@ -199,8 +205,6 @@ NSPopoverDelegate>
         }
         self.label.stringValue = @"";
         
-//        self.button.layer.backgroundColor = [NSColor colorWithRed:221/255.0 green:44/255.0 blue:0/255.0 alpha:1].CGColor;
-//        self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"Unlock Full Version", nil)];
         self.button.title = [NSString stringWithFormat:@" %@            ",NSLocalizedString(@"Upgrade", nil)];
         [self.button setAlignment:NSTextAlignmentCenter];
         self.bgImg.hidden = NO;
@@ -226,12 +230,10 @@ NSPopoverDelegate>
             self.bgImg.hidden = NO;
             self.button.layer.backgroundColor = [NSColor clearColor].CGColor;
             [self.button setAlignment:NSTextAlignmentCenter];
-//            [self.view removeTrackingArea:self.trackingArea];
         }
     } else if (ActivityStatusVerifExpire == [VerificationManager manager].status) {
         self.labelContentView.hidden = self.bgImg.hidden = self.button.hidden = NO;
         self.label.stringValue = @"";
-//        self.button.layer.backgroundColor = [NSColor colorWithRed:221/255.0 green:44/255.0 blue:0/255.0 alpha:1].CGColor;
         self.button.title = [NSString stringWithFormat:@" %@            ",NSLocalizedString(@"Upgrade", nil)];
         [self.button setTitleColor:[NSColor whiteColor]];
         self.bgImg.hidden = NO;
@@ -290,6 +292,7 @@ NSPopoverDelegate>
     } else {
         self.labelContentView.hidden = self.bgImg.hidden = self.button.hidden = YES;
     }
+        
 #endif
 
     [self.button sizeToFit];
@@ -346,8 +349,97 @@ NSPopoverDelegate>
         totalWidth += 8;
     }
     
+    if (!self.secondTrialBtn.hidden) {
+        self.secondTrialBtn.frame = CGRectMake(MAX(CGRectGetMaxX(self.labelContentView.frame) - self.button.frame.size.width, 0), kbottomGap, self.button.frame.size.width, self.view.frame.size.height -2 *kbottomGap);
+    }
+//    if (self.view.superview) {
+//        self.view.frame = CGRectMake(MAX(0, CGRectGetWidth(self.view.superview.frame)-totalWidth - 8), (CGRectGetHeight(self.view.superview.frame)-CGRectGetHeight(self.view.frame))/2., totalWidth, self.view.frame.size.height);
+//    } else {
+//        if (self.button.hidden) {
+//            self.view.frame = CGRectMake(0,0, CGRectGetMaxX(self.aiLabel.frame) + 20 ,self.view.frame.size.height);
+//        } else {
+//            self.view.frame = CGRectMake(0,0, CGRectGetMaxX(self.button.frame) ,self.view.frame.size.height);
+//        }
+//    }
+    
+    if (self.frameUpdateHandle) {
+        self.frameUpdateHandle(self.view.frame);
+    }
+
+//    CGRect rect = self.button.frame;
+//    self.bgImg.frame = rect;
+    
+    // PDF Reader Pro Lite
+    // 未登录 - 无订阅 - 无AI
+    // 未登录 - 有订阅高级版+有AI序列码
+    // 已登录(未试用过的免费用户+未订阅AI) -  无订阅+无AI旧剩余点数
+    // 已登录(试用到期且未付费用户+未订阅AI) -  无旧订阅+有AI旧剩余点数
+    // 已登录(新的买断会员+有订阅AI) -  无旧订阅+无AI旧剩余点数
+    // 已登录(自动订阅中 + 订阅AI) -  无旧订阅+有AI旧剩余点数
+    // 已登录(订阅中但取消续订用户) -  无旧订阅+无AI旧剩余点数
+    // 已登录(订阅过期用户) -  无旧订阅+无AI旧剩余点数
+    // 已登录(试用过期用户) -  无旧订阅+无AI旧剩余点数
+    
+    // PDF Reader Pro
+    // 未登录 - 标准版+无AI
+    // 未登录 - 高级版(有购买转档包)+有AI序列码
+    // 已登录(未试用过的免费用户+未订阅AI) -  标准版+无AI旧剩余点数
+    // 已登录(新的买断会员+有订阅AI) -  高级版(有升级转档包)+无AI旧剩余点数
+    // 已登录(全平台高级版年订阅自动订阅中 + 订阅AI) -  无旧订阅+有AI旧剩余点数
+    // 已登录(全平台标准版年订阅订阅中但取消续订用户) -  标准版+无AI旧剩余点数
+    // 已登录(订阅过期用户) -  高级版+无AI旧剩余点数
+    
+    // PDF Reader Pro DMG
+    // 未登录 - 无激活+无AI序列码
+    // 未登录 - 有激活标准版+有AI序列码
+    // 未登录 - 有激活高级版+无AI序列码
+    // 已登录(未试用过的免费用户+未订阅AI) -  无激活+无AI序列码
+    // 已登录(新的买断会员+有订阅AI) -  无激活+无AI序列码
+    // 已登录(自动订阅中 + 订阅AI) -  无激活+有AI序列码
+    // 已登录(订阅中但取消续订用户) -  无激活+无AI
+    // 已登录(订阅过期用户) -  无激活+无AI
+    
+    totalWidth = 8;
+    self.button.hidden = YES;
+    self.label.hidden = YES;
+    self.secondTrialBtn.hidden = YES;
+    self.labelContentView.hidden = YES;
+    self.bgImg.hidden = YES;
+    self.aiContendView.hidden = YES;
+    self.userButton.hidden = YES;
+    self.signUpView.hidden = YES;
+    self.signUpLabel.stringValue = NSLocalizedStringFromTable(@"Sign Up", @"MemberCenterLocalizable", nil);
+    [self.signUpLabel sizeToFit];
+    CGFloat signUpWidth = self.signUpLabel.frame.size.width;
+    signUpWidth += 4;
+    signUpWidth += 8;
+    signUpWidth += 8;
+    signUpWidth += 12;
+    self.signUpImg.frame = CGRectMake(8, CGRectGetHeight(self.view.frame)/2.-6, 12, 12);
+    CGRect signUplabelRect = self.signUpLabel.frame;
+    signUplabelRect.origin.x = CGRectGetMaxX(self.signUpImg.frame) + 4;
+    self.signUpLabel.frame = signUplabelRect;
+
+    self.button.layer.backgroundColor = [NSColor clearColor].CGColor;
+    self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"Upgrade to Pro", nil)];
+    [self.button setTitleColor:[NSColor whiteColor]];
+    
+    self.aiLabel.stringValue = NSLocalizedString(@"My AI Credit", nil);
+    [self.aiLabel sizeToFit];
+    CGFloat aiWidth = self.aiLabel.frame.size.width;
+    aiWidth += 4;
+    aiWidth += 16;
+    aiWidth += 16;
+    self.aiIconImg.frame = CGRectMake(8, CGRectGetHeight(self.view.frame)/2.-8, 16, 16);
+    self.aiContendView.frame = CGRectMake(totalWidth, 0, aiWidth, self.view.frame.size.height);
+    CGRect ailabelRect = self.aiLabel.frame;
+    ailabelRect.origin.x = CGRectGetMaxX(self.aiIconImg.frame) + 4;
+    self.aiLabel.frame = ailabelRect;
+//    totalWidth+=aiWidth;
+//    totalWidth+=4;
+    
     CGFloat userImageWidth = 24;
-    self.userButton.frame = CGRectMake(totalWidth, 0, userImageWidth, userImageWidth);
+//    self.userButton.frame = CGRectMake(totalWidth, 0, userImageWidth, userImageWidth);
     totalWidth += userImageWidth;
     totalWidth += 8;
     if ([KMMemberInfo shared].isLogin) {
@@ -355,9 +447,60 @@ NSPopoverDelegate>
     } else {
         self.userButton.image = [NSImage imageNamed:@"UserProfilePicture1"];
     }
-    
-    if (!self.secondTrialBtn.hidden) {
-        self.secondTrialBtn.frame = CGRectMake(MAX(CGRectGetMaxX(self.labelContentView.frame) - self.button.frame.size.width, 0), kbottomGap, self.button.frame.size.width, self.view.frame.size.height -2 *kbottomGap);
+
+    CGFloat buttonWidth = CGRectGetMaxX(self.button.frame);
+    NSRect btnRect = [self.button.attributedTitle boundingRectWithSize:CGSizeMake(MAXFLOAT, CGRectGetHeight(self.button.frame)) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading];
+    if (fabs(buttonWidth-btnRect.size.width)>50) {
+        buttonWidth = btnRect.size.width + 10;
+    }
+    if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type1 || [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type2) {
+        self.bgImg.hidden = NO;
+        self.button.hidden = NO;
+        self.signUpView.hidden = NO;
+        self.button.frame = CGRectMake(totalWidth, kbottomGap, buttonWidth, self.view.frame.size.height -2 *kbottomGap);
+        CGRect rect = self.button.frame;
+        self.bgImg.frame = rect;
+        totalWidth+=CGRectGetWidth(self.button.bounds);
+        totalWidth+=4;
+        self.signUpView.frame = CGRectMake(totalWidth, 0, signUpWidth, self.view.frame.size.height);
+        totalWidth+=CGRectGetWidth(self.signUpView.bounds);
+    } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type3 || [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type4) {
+        self.signUpView.hidden = NO;
+        self.signUpView.frame = CGRectMake(totalWidth, 0, signUpWidth, self.view.frame.size.height);
+        totalWidth+=CGRectGetWidth(self.signUpView.bounds);
+    } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type5 ||
+               [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type6 ||
+               [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type7 ||
+               [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type10 ||
+               [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type11) {
+        if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type5) {
+            self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"Free Trial", nil)];
+        } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type6 ||
+                   [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type10 ||
+                   [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type11) {
+            self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedStringFromTable(@"立即续费", @"MemberCenterLocalizable", nil)];
+        } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type7) {
+            self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedStringFromTable(@"立即升级", @"MemberCenterLocalizable", nil)];
+        }
+        [self.button setTitleColor:[NSColor whiteColor]];
+        self.bgImg.hidden = NO;
+        self.button.hidden = NO;
+        self.userButton.hidden = NO;
+        self.button.frame = CGRectMake(totalWidth, kbottomGap, buttonWidth, self.view.frame.size.height -2 *kbottomGap);
+        CGRect rect = self.button.frame;
+        self.bgImg.frame = rect;
+        totalWidth+=CGRectGetWidth(self.button.bounds);
+        totalWidth+=8;
+        
+        self.userButton.frame = CGRectMake(totalWidth, 0, userImageWidth, userImageWidth);
+        totalWidth += userImageWidth;
+        totalWidth += 8;
+    } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type8 ||
+               [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type9) {
+        self.userButton.hidden = NO;
+        self.userButton.frame = CGRectMake(totalWidth, 0, userImageWidth, userImageWidth);
+        totalWidth += userImageWidth;
+        totalWidth += 8;
     }
     if (self.view.superview) {
         self.view.frame = CGRectMake(MAX(0, CGRectGetWidth(self.view.superview.frame)-totalWidth - 8), (CGRectGetHeight(self.view.superview.frame)-CGRectGetHeight(self.view.frame))/2., totalWidth, self.view.frame.size.height);
@@ -368,19 +511,6 @@ NSPopoverDelegate>
             self.view.frame = CGRectMake(0,0, CGRectGetMaxX(self.button.frame) ,self.view.frame.size.height);
         }
     }
-    
-    if (self.frameUpdateHandle) {
-        self.frameUpdateHandle(self.view.frame);
-    }
-
-    CGRect rect = self.button.frame;
-    self.bgImg.frame = rect;
-    
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(popoverShowNoti:) name:@"KMVerificationMessagePopShowNoti" object:nil];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loginSuccessNotification:) name:@"MemberCenterLoginSuccess" object:nil];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(logoutSuccessNotification:) name:@"MemberCenterLogoutSuccess" object:nil];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(expandPersonalCenterNotification:) name:@"ExpandPersonalCenter" object:nil];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(closeMenu:) name:@"CloseMenuNotification" object:nil];
 }
 
 #pragma mark - Button Actions
@@ -390,157 +520,173 @@ NSPopoverDelegate>
         KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeRepeatTrialGuide];
         [vc showWindow:nil];
     } else {
-        [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
+        [[KMProductCompareWC shared] setOrientation:NO];
+        [[KMProductCompareWC shared] showWindow:nil];
     }
 }
 
 - (IBAction)buttonAction:(id)sender {
-    BOOL isFree = NO;
-
-#if VERSION_DMG
-    if (ActivityStatusNone == [VerificationManager manager].status) {
-        //弹出 试用弹窗UI优化-新用户试用路径 新UI 情况一 右上角按钮
-        KMPurchaseFirstTrialWindowController *firstTrialWC = [KMPurchaseFirstTrialWindowController currentFirstTrialWC];
-        firstTrialWC.buttonActionBlock = ^(KMPurchaseFirstTrialWindowController * _Nonnull ftWC, KMButton * _Nonnull btn, NSString * _Nonnull email, NSString * _Nonnull name) {
-            if (btn.tag == 10001) {
-                if (ActivityStatusNone == [VerificationManager manager].status ||
-                    ActivityStatusTrialExpire == [VerificationManager manager].status) {
-
-                    [[FMTrackEventManager defaultManager] trackEventWithEvent:@"Tbr" withProperties:@{@"Tbr_Btn":@"Btn_Tbr_SecondTrial"}];
-                    [[VerificationManager manager] trialForDays:7
-                                                          email:email?:[VerificationManager manager].email
-                                                           name:name?:[VerificationManager manager].accountName
-                                                    complention:^(ActivityStatus status, NSDictionary *info, NSError *error) {
-                        if (error ||
-                            status != ActivityStatusTrial) {
-                            NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Activation Error", nil)
-                                                             defaultButton:NSLocalizedString(@"Try Again", nil)
-                                                           alternateButton:nil
-                                                               otherButton:nil
-                                                 informativeTextWithFormat:NSLocalizedString(@"Failed to sign up for the free trial. Please make sure your internet connection is available and try again later.", nil), nil];
-                            [alert runModal];
-                        } else {
-                            KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeRepeatTrialSuccess];
-                            [vc showWindow:nil];
-                        }
-                    }];
-                    [ftWC close];
-                } else {
-                    [ftWC close];
-                    KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivate];
-                    vc.callback = ^{
-                        [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
-                    };
-                    [vc showWindow:nil];
-                }
-            } else if (btn.tag == 10002) {
-                NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@?utm_source=app_dmg&utm_medium=dmg_puw_free_trial", Swift_oc_Tool.Store_Link_OC]];
-                [[NSWorkspace sharedWorkspace] openURL:url];
-                [[FMTrackEventManager defaultManager] trackEventWithEvent:@"PUW" withProperties:@{@"PUW_Btn":@"PUW_Btn_UpgradeBuyNow"}];
-            } else if (btn.tag == 10003) {
-                KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivate];//KMVerificationTypeActivate
-                [vc showWindow:nil];
-                [ftWC close];
-            }
-        };
-        [firstTrialWC.window center];
-        [firstTrialWC showWindow:nil];
-    } else if (ActivityStatusTrialExpire == [VerificationManager manager].status ||
-               ActivityStatusTrial == [VerificationManager manager].status) {
-//        if ([VerificationManager manager].secondTrialEnabled) {
-//            if (!self.checkValue) {
-//                [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
+//    BOOL isFree = NO;
+//
+//#if VERSION_DMG
+//    if (ActivityStatusNone == [VerificationManager manager].status) {
+//        //弹出 试用弹窗UI优化-新用户试用路径 新UI 情况一 右上角按钮
+//        KMPurchaseFirstTrialWindowController *firstTrialWC = [KMPurchaseFirstTrialWindowController currentFirstTrialWC];
+//        firstTrialWC.buttonActionBlock = ^(KMPurchaseFirstTrialWindowController * _Nonnull ftWC, KMButton * _Nonnull btn, NSString * _Nonnull email, NSString * _Nonnull name) {
+//            if (btn.tag == 10001) {
+//                if (ActivityStatusNone == [VerificationManager manager].status ||
+//                    ActivityStatusTrialExpire == [VerificationManager manager].status) {
+//
+//                    [[FMTrackEventManager defaultManager] trackEventWithEvent:@"Tbr" withProperties:@{@"Tbr_Btn":@"Btn_Tbr_SecondTrial"}];
+//                    [[VerificationManager manager] trialForDays:7
+//                                                          email:email?:[VerificationManager manager].email
+//                                                           name:name?:[VerificationManager manager].accountName
+//                                                    complention:^(ActivityStatus status, NSDictionary *info, NSError *error) {
+//                        if (error ||
+//                            status != ActivityStatusTrial) {
+//                            NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Activation Error", nil)
+//                                                             defaultButton:NSLocalizedString(@"Try Again", nil)
+//                                                           alternateButton:nil
+//                                                               otherButton:nil
+//                                                 informativeTextWithFormat:NSLocalizedString(@"Failed to sign up for the free trial. Please make sure your internet connection is available and try again later.", nil), nil];
+//                            [alert runModal];
+//                        } else {
+//                            KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeRepeatTrialSuccess];
+//                            [vc showWindow:nil];
+//                        }
+//                    }];
+//                    [ftWC close];
+//                } else {
+//                    [ftWC close];
+//                    KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivate];
+//                    vc.callback = ^{
+//                        [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
+//                    };
+//                    [vc showWindow:nil];
+//                }
+//            } else if (btn.tag == 10002) {
+//                NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@?utm_source=app_dmg&utm_medium=dmg_puw_free_trial", Swift_oc_Tool.Store_Link_OC]];
+//                [[NSWorkspace sharedWorkspace] openURL:url];
+//                [[FMTrackEventManager defaultManager] trackEventWithEvent:@"PUW" withProperties:@{@"PUW_Btn":@"PUW_Btn_UpgradeBuyNow"}];
+//            } else if (btn.tag == 10003) {
+//                KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivate];//KMVerificationTypeActivate
+//                [vc showWindow:nil];
+//                [ftWC close];
+//            }
+//        };
+//        [firstTrialWC.window center];
+//        [firstTrialWC showWindow:nil];
+//    } else if (ActivityStatusTrialExpire == [VerificationManager manager].status ||
+//               ActivityStatusTrial == [VerificationManager manager].status) {
+//            [[NSNotificationCenter defaultCenter] postNotificationName:@"KMVerificationMessagePopShowNoti" object:nil];
+//            
+//        if (!self.testVC) {
+//            self.testVC = [[KMUnlockAlertViewController alloc] init];
+//        }
+//        [self.testVC addtrackingAreaInfo];
+//        self.testVC.callback = ^(NSInteger index) {
+//                if (index == 1) {
+//                    KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivate];
+//                    [vc showWindow:nil];
+//                } else if (index == 2) {
+//                    KMPurchaseEmbeddedWindowController *embeddedWC = [KMPurchaseEmbeddedWindowController currentFirstTrialWC:@"com.brother.pdfreaderpro.mac.product_3"];
+//                    [embeddedWC showWindow:nil];
+//                    [[embeddedWC window] center];
+//                }
+//            };
+//        self.testVC.mouseEventCall = ^(BOOL mouseEnter) {
+//            if (mouseEnter) {
+//                self.stopPopOverHide = YES;
+//                if (ActivityStatusTrialExpire == [VerificationManager manager].status ||
+//                    ActivityStatusTrial == [VerificationManager manager].status) {
+//                    if (!self.popover.isShown) {
+//                        [self buttonAction:self.button];
+//                    }
+//                }
+//            } else {
+//                self.stopPopOverHide = NO;
+//                if (self.popover) {
+//                    [self.popover close];
+//                }
+//                [self.testVC removeTrackingAreaInfo];
 //            }
+//        };
+//            NSPopover *popover = [[NSPopover alloc] init];
+//            popover.delegate = self;
+//            popover.contentViewController = self.testVC;
+//            popover.animates = YES;
+//            popover.behavior = NSPopoverBehaviorTransient;
+//            [popover showRelativeToRect:[sender bounds] ofView:sender preferredEdge:NSMinYEdge];
+//            self.popover = popover;
+//    } else if (ActivityStatusVerifExpire == [VerificationManager manager].status) {
+//        KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivateExpired];
+//        [vc showWindow:nil];
+//    } else if (ActivityStatusVerification == [VerificationManager manager].status) {
+//        if ([VerificationManager manager].needUpgradeLicense) {
+//            KMPurchaseEmbeddedWindowController *embeddedWC = [KMPurchaseEmbeddedWindowController currentFirstTrialWC:@"com.brother.pdfreaderpro.mac.product_2"];
+//            [embeddedWC showWindow:nil];
+//            [[embeddedWC window] center];
+//        }
+//    } else {
+//        if ([VerificationManager manager].needUpgradeLicense) {
+//            KMPurchaseEmbeddedWindowController *embeddedWC = [KMPurchaseEmbeddedWindowController currentFirstTrialWC:@"com.brother.pdfreaderpro.mac.product_2"];
+//            [embeddedWC showWindow:nil];
+//            [[embeddedWC window] center];
 //        } else {
-            [[NSNotificationCenter defaultCenter] postNotificationName:@"KMVerificationMessagePopShowNoti" object:nil];
-            
-        if (!self.testVC) {
-            self.testVC = [[KMUnlockAlertViewController alloc] init];
-        }
-        [self.testVC addtrackingAreaInfo];
-        self.testVC.callback = ^(NSInteger index) {
-                if (index == 1) {
-                    KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivate];
-                    [vc showWindow:nil];
-                } else if (index == 2) {
-//                    NSURL *url = [NSURL URLWithString:Swift_oc_Tool.Store_Link_OC];
-//                    [[NSWorkspace sharedWorkspace] openURL:url];
-//                    [[FMTrackEventManager defaultManager] trackEventWithEvent:@"PUW" withProperties:@{@"PUW_Btn":@"Btn_PUW_BuyNow-Expire"}];
-                    KMPurchaseEmbeddedWindowController *embeddedWC = [KMPurchaseEmbeddedWindowController currentFirstTrialWC:@"com.brother.pdfreaderpro.mac.product_3"];
-                    [embeddedWC showWindow:nil];
-                    [[embeddedWC window] center];
-                }
-            };
-        self.testVC.mouseEventCall = ^(BOOL mouseEnter) {
-            if (mouseEnter) {
-                self.stopPopOverHide = YES;
-                if (ActivityStatusTrialExpire == [VerificationManager manager].status ||
-                    ActivityStatusTrial == [VerificationManager manager].status) {
-                    if (!self.popover.isShown) {
-                        [self buttonAction:self.button];
-                    }
-                }
-            } else {
-                self.stopPopOverHide = NO;
-                if (self.popover) {
-                    [self.popover close];
-                }
-                [self.testVC removeTrackingAreaInfo];
-            }
-        };
-            NSPopover *popover = [[NSPopover alloc] init];
-            popover.delegate = self;
-            popover.contentViewController = self.testVC;
-            popover.animates = YES;
-            popover.behavior = NSPopoverBehaviorTransient;
-            [popover showRelativeToRect:[sender bounds] ofView:sender preferredEdge:NSMinYEdge];
-            self.popover = popover;
+//            KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeNormal];
+//            [vc showWindow:nil];
 //        }
-    } else if (ActivityStatusVerifExpire == [VerificationManager manager].status) {
-        KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivateExpired];
-        [vc showWindow:nil];
-    } else if (ActivityStatusVerification == [VerificationManager manager].status) {
-        if ([VerificationManager manager].needUpgradeLicense) {
-//            NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@?product_code=product_2", Swift_oc_Tool.Store_Link_OC]];
-//            [[NSWorkspace sharedWorkspace] openURL:url];
-//            [[FMTrackEventManager defaultManager] trackEventWithEvent:@"Tbr" withProperties:@{@"Tbr_Btn":@"Btn_Tbr_PDFtoOffice"}];
-            KMPurchaseEmbeddedWindowController *embeddedWC = [KMPurchaseEmbeddedWindowController currentFirstTrialWC:@"com.brother.pdfreaderpro.mac.product_2"];
-            [embeddedWC showWindow:nil];
-            [[embeddedWC window] center];
-        }
-    } else {
-        if ([VerificationManager manager].needUpgradeLicense) {
-//            NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@?product_code=product_2", Swift_oc_Tool.Store_Link_OC]];
-//            [[NSWorkspace sharedWorkspace] openURL:url];
-//            [[FMTrackEventManager defaultManager] trackEventWithEvent:@"Tbr" withProperties:@{@"Tbr_Btn":@"Btn_Tbr_PDFtoOffice"}];
-            KMPurchaseEmbeddedWindowController *embeddedWC = [KMPurchaseEmbeddedWindowController currentFirstTrialWC:@"com.brother.pdfreaderpro.mac.product_2"];
-            [embeddedWC showWindow:nil];
-            [[embeddedWC window] center];
+//    }
+//#else
+//    isFree = YES;
+//#if VERSION_FREE
+//    if ([IAPProductsManager defaultManager].isAvailableAllFunction) {
+//        isFree = NO;
+//    }
+//    if (isFree) {
+//        [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
+//    }
+//#else
+//    if (![IAPProductsManager defaultManager].isAvailableAdvancedPDFToOffice) {
+//        KMToolCompareWindowController *vc = [KMToolCompareWindowController toolCompareWithToolType:KMCompareWithToolTypeConvert selectNum:0];
+//        [vc.window center];
+//        [vc showWindow:nil];
+//    }
+//#endif
+//    
+//#endif
+    
+    if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type1 || 
+        [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type2 ||
+        [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type3 ||
+        [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type4) {
+        if ([KMMemberInfo shared].isLogin) {
+            [[KMProductCompareWC shared] setOrientation:YES];
+            [[KMProductCompareWC shared] setOrientationType:KMCompareTableTypeLite_Base];
+            [[KMProductCompareWC shared] showWindow:nil];
         } else {
-            KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeNormal];
-            [vc showWindow:nil];
+            [KMLoginWindowsController.shared openWindow:^(BOOL success) {
+                if (success) {
+                    [[KMProductCompareWC shared] setOrientation:YES];
+                    [[KMProductCompareWC shared] setOrientationType:KMCompareTableTypeLite_Base];
+                    [[KMProductCompareWC shared] showWindow:nil];
+                }
+            }];
         }
+    } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type5) {
+        [[KMProductCompareWC shared] setOrientation:NO];
+        [[KMProductCompareWC shared] showWindow:nil];
+    } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type6 ||
+               [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type10 ||
+               [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type11) {
+        [[KMProductCompareWC shared] setOrientation:YES];
+        [[KMProductCompareWC shared] setOrientationType:KMCompareTableTypeLite_Base];
+        [[KMProductCompareWC shared] showWindow:nil];
+    } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type7) {
+        [[KMProductCompareWC shared] setOrientation:YES];
+        [[KMProductCompareWC shared] setOrientationType:KMCompareTableTypeLite_MacWindows];
+        [[KMProductCompareWC shared] showWindow:nil];
     }
-#else
-    isFree = YES;
-#if VERSION_FREE
-    if ([IAPProductsManager defaultManager].isAvailableAllFunction) {
-        isFree = NO;
-    }
-    if (isFree) {
-        [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
-    }
-#else
-    if (![IAPProductsManager defaultManager].isAvailableAdvancedPDFToOffice) {
-//        KMToolCompareWindowController *vc = [KMToolCompareWindowController toolCompareWithType:KMCompareWithToolType_Convert setSelectIndex:0];
-        KMToolCompareWindowController *vc = [KMToolCompareWindowController toolCompareWithToolType:KMCompareWithToolTypeConvert selectNum:0];
-        [vc.window center];
-        [vc showWindow:nil];
-    }
-#endif
-    
-#endif
-    
 }
 
 - (NSAttributedString *)numberConvertColor:(NSColor*)color String:(NSString *)string {
@@ -571,8 +717,6 @@ NSPopoverDelegate>
     AIUserInfoController *controller = [[AIUserInfoController alloc] init];
     controller.purchaseHandle = ^(AIUserInfoController * _Nonnull vc) {
 #if VERSION_DMG
-//        NSURL *url = [NSURL URLWithString:Swift_oc_Tool.AIProduct_Link_OC];
-//        [[NSWorkspace sharedWorkspace] openURL:url];
         KMPurchaseEmbeddedWindowController *embeddedWC = [KMPurchaseEmbeddedWindowController currentFirstTrialWC:@"com.brother.pdfreaderpro.ai.product_1"];
         [embeddedWC showWindow:nil];
         [[embeddedWC window] center];
@@ -628,6 +772,10 @@ NSPopoverDelegate>
     [self.userMenu popUpMenuPositioningItem:nil atLocation:NSMakePoint(-130, 30) inView:sender];
 }
 
+- (IBAction)signUpAction:(NSButton *)sender {
+    [KMLoginWindowsController.shared showWindow:nil];
+}
+
 #pragma mark - NSNotification Methods
 - (void)deviceActivateStatusChangeNotification:(NSNotification *)notification {
     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.4 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
@@ -684,10 +832,12 @@ NSPopoverDelegate>
 
 - (void)loginSuccessNotification:(NSNotification *)noti {
     _userButton.image = [NSImage imageNamed:@"UserProfilePicture"];
+    [self reloadData];
 }
 
 - (void)logoutSuccessNotification:(NSNotification *)noti {
     _userButton.image = [NSImage imageNamed:@"UserProfilePicture1"];
+    [self reloadData];
 }
 
 - (void)expandPersonalCenterNotification:(NSNotification *)noti {

+ 44 - 3
PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationMessageViewController.xib

@@ -16,6 +16,9 @@
                 <outlet property="label" destination="CFu-6F-yoa" id="ewG-lF-Fh1"/>
                 <outlet property="labelContentView" destination="ke5-qF-WBV" id="PDK-eS-xef"/>
                 <outlet property="secondTrialBtn" destination="pIG-TY-YRO" id="CtU-7B-BUB"/>
+                <outlet property="signUpImg" destination="OWQ-bX-dHV" id="9pD-mT-8b9"/>
+                <outlet property="signUpLabel" destination="VXk-gj-6b7" id="nFh-q0-Sgi"/>
+                <outlet property="signUpView" destination="VSH-IJ-52g" id="nfu-Jj-V9A"/>
                 <outlet property="userButton" destination="46r-vS-ewJ" id="uK7-PU-6Yh"/>
                 <outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
             </connections>
@@ -23,7 +26,7 @@
         <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
         <customObject id="-3" userLabel="Application" customClass="NSObject"/>
         <customView id="Hz6-mo-xeY">
-            <rect key="frame" x="0.0" y="0.0" width="393" height="20"/>
+            <rect key="frame" x="0.0" y="0.0" width="531" height="20"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
             <subviews>
                 <customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ke5-qF-WBV">
@@ -104,8 +107,44 @@
                         </button>
                     </subviews>
                 </customView>
+                <customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="VSH-IJ-52g">
+                    <rect key="frame" x="184" y="0.0" width="163" height="20"/>
+                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                    <subviews>
+                        <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="NmA-6V-BX3">
+                            <rect key="frame" x="0.0" y="0.0" width="163" height="20"/>
+                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                            <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="axesIndependently" image="ButtonBackgroundImage2" id="HSb-3g-EDb"/>
+                        </imageView>
+                        <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="OWQ-bX-dHV">
+                            <rect key="frame" x="20" y="0.0" width="25" height="20"/>
+                            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                            <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="UserProfilePicture2" id="DMD-nC-6qw"/>
+                        </imageView>
+                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="VXk-gj-6b7">
+                            <rect key="frame" x="53" y="2" width="52" height="16"/>
+                            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                            <textFieldCell key="cell" lineBreakMode="clipping" title="Sign Up" id="lZZ-QK-wvb">
+                                <font key="font" metaFont="system"/>
+                                <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                            </textFieldCell>
+                        </textField>
+                        <button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Kd0-Aq-VuC">
+                            <rect key="frame" x="0.0" y="0.0" width="163" height="20"/>
+                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                            <buttonCell key="cell" type="bevel" bezelStyle="rounded" imagePosition="overlaps" alignment="center" lineBreakMode="charWrapping" imageScaling="axesIndependently" inset="2" id="AOW-kZ-DeO">
+                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                <font key="font" metaFont="smallSystem"/>
+                            </buttonCell>
+                            <connections>
+                                <action selector="signUpAction:" target="-2" id="tzc-WG-Zdp"/>
+                            </connections>
+                        </button>
+                    </subviews>
+                </customView>
                 <button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="46r-vS-ewJ">
-                    <rect key="frame" x="354" y="0.0" width="61" height="20"/>
+                    <rect key="frame" x="470" y="0.0" width="61" height="20"/>
                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                     <buttonCell key="cell" type="bevel" title="Button" bezelStyle="rounded" image="UserProfilePicture" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="JAR-DI-N4C">
                         <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@@ -116,13 +155,15 @@
                     </connections>
                 </button>
             </subviews>
-            <point key="canvasLocation" x="33.5" y="104"/>
+            <point key="canvasLocation" x="-35.5" y="104"/>
         </customView>
     </objects>
     <resources>
         <image name="AICreditIcon" width="103" height="20"/>
+        <image name="ButtonBackgroundImage2" width="100" height="32"/>
         <image name="Upgarde_bg_icon" width="98" height="20"/>
         <image name="UserProfilePicture" width="24" height="24"/>
+        <image name="UserProfilePicture2" width="12" height="12"/>
         <image name="aiIconA" width="16" height="16"/>
     </resources>
 </document>

+ 1 - 1
PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationWindowController.xib

@@ -19,7 +19,7 @@
             <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" fullSizeContentView="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="415" y="246" width="620" height="552"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1055"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/>
             <view key="contentView" wantsLayer="YES" id="se5-gp-TjO">
                 <rect key="frame" x="0.0" y="0.0" width="620" height="552"/>
                 <autoresizingMask key="autoresizingMask"/>

+ 12 - 8
PDF Office/PDF Master/Class/Tools/Search/Window/KMSearchReplaceWindowController.swift

@@ -410,14 +410,18 @@ class KMSearchReplaceWindowController: NSWindowController {
     
     func switchType(_ type: KMSearchReplaceType, animate: Bool = false) {
         if type == .replace {
-            if IAPProductsManager.default().isAvailableAllFunction() == false {
-//                KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
-                let winC = KMPurchaseCompareWindowController.sharedInstance()
-                winC?.showWindow(nil)
-                guard let win = winC?.window else {
-                    return
-                }
-                self.window?.addChildWindow(win, ordered: .above)
+//            if IAPProductsManager.default().isAvailableAllFunction() == false {
+//                KMProductCompareWC.shared.orientation = false
+//                let winC = KMProductCompareWC.shared
+//                winC.showWindow(nil)
+//                guard let win = winC.window else {
+//                    return
+//                }
+//                self.window?.addChildWindow(win, ordered: .above)
+//                return
+//            }
+            if KMMemberInfo.shared.isMemberAllFunction == false {
+                KMMemberInfo.shared.advancedFunctionUsage()
                 return
             }
         }

+ 22 - 0
PDF Office/PDF Master/MemberCenter/Assets/MemberCenter.xcassets/Image/UserProfilePicture2.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "Frame 1000006513.pdf",
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "filename" : "Frame 1000006512.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 152 - 0
PDF Office/PDF Master/MemberCenter/Assets/MemberCenter.xcassets/Image/UserProfilePicture2.imageset/Frame 1000006512.pdf

@@ -0,0 +1,152 @@
+%PDF-1.7
+
+1 0 obj
+  << /Type /XObject
+     /Length 2 0 R
+     /Group << /Type /Group
+               /S /Transparency
+            >>
+     /Subtype /Form
+     /Resources << >>
+     /BBox [ 0.000000 0.000000 12.000000 12.000000 ]
+  >>
+stream
+q
+1.000000 0.000000 -0.000000 1.000000 3.600098 4.500000 cm
+0.988235 0.992157 1.000000 scn
+4.800000 2.399805 m
+4.800000 1.074321 3.725484 -0.000196 2.400000 -0.000196 c
+1.074517 -0.000196 0.000000 1.074321 0.000000 2.399805 c
+0.000000 3.725288 1.074517 4.799805 2.400000 4.799805 c
+3.725484 4.799805 4.800000 3.725288 4.800000 2.399805 c
+h
+f
+n
+Q
+q
+1.000000 0.000000 -0.000000 1.000000 1.199951 -5.699219 cm
+0.988235 0.992157 1.000000 scn
+9.600000 4.799609 m
+9.600000 2.148642 7.450967 -0.000391 4.800000 -0.000391 c
+2.149033 -0.000391 0.000000 2.148642 0.000000 4.799609 c
+0.000000 7.450576 2.149033 9.599609 4.800000 9.599609 c
+7.450967 9.599609 9.600000 7.450576 9.600000 4.799609 c
+h
+f
+n
+Q
+
+endstream
+endobj
+
+2 0 obj
+  693
+endobj
+
+3 0 obj
+  << /Type /XObject
+     /Length 4 0 R
+     /Group << /Type /Group
+               /S /Transparency
+            >>
+     /Subtype /Form
+     /Resources << >>
+     /BBox [ 0.000000 0.000000 12.000000 12.000000 ]
+  >>
+stream
+q
+1.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 cm
+0.000000 0.000000 0.000000 scn
+0.000000 6.000000 m
+0.000000 9.313708 2.686292 12.000000 6.000000 12.000000 c
+6.000000 12.000000 l
+9.313708 12.000000 12.000000 9.313708 12.000000 6.000000 c
+12.000000 6.000000 l
+12.000000 2.686292 9.313708 0.000000 6.000000 0.000000 c
+6.000000 0.000000 l
+2.686292 0.000000 0.000000 2.686292 0.000000 6.000000 c
+0.000000 6.000000 l
+h
+f
+n
+Q
+
+endstream
+endobj
+
+4 0 obj
+  431
+endobj
+
+5 0 obj
+  << /XObject << /X1 1 0 R >>
+     /ExtGState << /E1 << /SMask << /Type /Mask
+                                    /G 3 0 R
+                                    /S /Alpha
+                                 >>
+                          /Type /ExtGState
+                       >> >>
+  >>
+endobj
+
+6 0 obj
+  << /Length 7 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+/E1 gs
+/X1 Do
+Q
+
+endstream
+endobj
+
+7 0 obj
+  46
+endobj
+
+8 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 12.000000 12.000000 ]
+     /Resources 5 0 R
+     /Contents 6 0 R
+     /Parent 9 0 R
+  >>
+endobj
+
+9 0 obj
+  << /Kids [ 8 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+10 0 obj
+  << /Pages 9 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 11
+0000000000 65535 f
+0000000010 00000 n
+0000000951 00000 n
+0000000973 00000 n
+0000001652 00000 n
+0000001674 00000 n
+0000001972 00000 n
+0000002074 00000 n
+0000002095 00000 n
+0000002268 00000 n
+0000002342 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 10 0 R
+   /Size 11
+>>
+startxref
+2402
+%%EOF

+ 152 - 0
PDF Office/PDF Master/MemberCenter/Assets/MemberCenter.xcassets/Image/UserProfilePicture2.imageset/Frame 1000006513.pdf

@@ -0,0 +1,152 @@
+%PDF-1.7
+
+1 0 obj
+  << /Type /XObject
+     /Length 2 0 R
+     /Group << /Type /Group
+               /S /Transparency
+            >>
+     /Subtype /Form
+     /Resources << >>
+     /BBox [ 0.000000 0.000000 12.000000 12.000000 ]
+  >>
+stream
+q
+1.000000 0.000000 -0.000000 1.000000 3.600098 4.500000 cm
+0.988235 0.992157 1.000000 scn
+4.800000 2.399805 m
+4.800000 1.074321 3.725484 -0.000196 2.400000 -0.000196 c
+1.074517 -0.000196 0.000000 1.074321 0.000000 2.399805 c
+0.000000 3.725288 1.074517 4.799805 2.400000 4.799805 c
+3.725484 4.799805 4.800000 3.725288 4.800000 2.399805 c
+h
+f
+n
+Q
+q
+1.000000 0.000000 -0.000000 1.000000 1.199951 -5.699219 cm
+0.988235 0.992157 1.000000 scn
+9.600000 4.799609 m
+9.600000 2.148642 7.450967 -0.000391 4.800000 -0.000391 c
+2.149033 -0.000391 0.000000 2.148642 0.000000 4.799609 c
+0.000000 7.450576 2.149033 9.599609 4.800000 9.599609 c
+7.450967 9.599609 9.600000 7.450576 9.600000 4.799609 c
+h
+f
+n
+Q
+
+endstream
+endobj
+
+2 0 obj
+  693
+endobj
+
+3 0 obj
+  << /Type /XObject
+     /Length 4 0 R
+     /Group << /Type /Group
+               /S /Transparency
+            >>
+     /Subtype /Form
+     /Resources << >>
+     /BBox [ 0.000000 0.000000 12.000000 12.000000 ]
+  >>
+stream
+q
+1.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 cm
+0.000000 0.000000 0.000000 scn
+0.000000 6.000000 m
+0.000000 9.313708 2.686292 12.000000 6.000000 12.000000 c
+6.000000 12.000000 l
+9.313708 12.000000 12.000000 9.313708 12.000000 6.000000 c
+12.000000 6.000000 l
+12.000000 2.686292 9.313708 0.000000 6.000000 0.000000 c
+6.000000 0.000000 l
+2.686292 0.000000 0.000000 2.686292 0.000000 6.000000 c
+0.000000 6.000000 l
+h
+f
+n
+Q
+
+endstream
+endobj
+
+4 0 obj
+  431
+endobj
+
+5 0 obj
+  << /XObject << /X1 1 0 R >>
+     /ExtGState << /E1 << /SMask << /Type /Mask
+                                    /G 3 0 R
+                                    /S /Alpha
+                                 >>
+                          /Type /ExtGState
+                       >> >>
+  >>
+endobj
+
+6 0 obj
+  << /Length 7 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+/E1 gs
+/X1 Do
+Q
+
+endstream
+endobj
+
+7 0 obj
+  46
+endobj
+
+8 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 12.000000 12.000000 ]
+     /Resources 5 0 R
+     /Contents 6 0 R
+     /Parent 9 0 R
+  >>
+endobj
+
+9 0 obj
+  << /Kids [ 8 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+10 0 obj
+  << /Pages 9 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 11
+0000000000 65535 f
+0000000010 00000 n
+0000000951 00000 n
+0000000973 00000 n
+0000001652 00000 n
+0000001674 00000 n
+0000001972 00000 n
+0000002074 00000 n
+0000002095 00000 n
+0000002268 00000 n
+0000002342 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 10 0 R
+   /Size 11
+>>
+startxref
+2402
+%%EOF

+ 190 - 0
PDF Office/PDF Master/MemberCenter/Model/KMMemberInfo.swift

@@ -7,6 +7,22 @@
 
 import Cocoa
 
+// 用户场景类型
+@objc enum KMUserScenarioType : Int {
+    case null = 0       // 默认状态
+    case lite_type1     // 免费版 未登录 - 无订阅+无AI    (右上角导航栏按钮 - “登录领福利” + “升级至Pro”)
+    case lite_type2     // 免费版 未登录 - 无订阅+有AI    (右上角导航栏按钮 - “登录领福利” + “升级至Pro”)
+    case lite_type3     // 免费版 未登录 - 有订阅高级版+有AI序列码  (右上角导航栏按钮 - “登录领福利”)
+    case lite_type4     // 免费版 未登录 - 有订阅高级版+无AI序列码  (右上角导航栏按钮 - “登录领福利”)
+    case lite_type5     // 免费版 已登录(未试用过的免费用户+未订阅AI) -  无订阅+无AI旧剩余点数 (右上角导航栏按钮 - 头像 + 立即试用)
+    case lite_type6     // 免费版 已登录(试用到期且未付费用户+未订阅AI) -  无旧订阅+有AI旧剩余点数   (右上角导航栏按钮 - 头像 + 立即续费)
+    case lite_type7     // 免费版 已登录(新的买断会员+有订阅AI) -  无旧订阅+无AI旧剩余点数   (右上角导航栏按钮 - 头像 + 立即升级)
+    case lite_type8     // 免费版 已登录(自动订阅中 + 订阅AI) -  无旧订阅+有AI旧剩余点数    (右上角导航栏按钮 - 头像)
+    case lite_type9     // 免费版 已登录(订阅中但取消续订用户) -  无旧订阅+无AI旧剩余点数    (右上角导航栏按钮 - 头像)
+    case lite_type10    // 免费版 已登录(订阅过期用户) -  无旧订阅+无AI旧剩余点数     (右上角导航栏按钮 - 头像 + 立即续费)
+    case lite_type11    // 免费版 已登录(试用过期用户) -  无旧订阅+无AI旧剩余点数     (右上角导航栏按钮 - 头像 + 立即续费)
+}
+
 @objcMembers class KMMemberInfo: NSObject {
     
     static let shared = KMMemberInfo()
@@ -191,6 +207,142 @@ import Cocoa
         }
     }
     
+    // 用户当前的状态
+    var userScenarioType: KMUserScenarioType {
+        get {
+            let oldAIPoints = AIInfoManager.default().aiInfo.totalToken - AIInfoManager.default().aiInfo.usedTimes // 旧版AI点数
+#if VERSION_FREE
+#if VERSION_DMG
+    // DMG
+            if KMMemberInfo.shared.isLogin {
+                
+            } else {
+                
+            }
+#else
+    // AppStore 免费版本
+            if KMMemberInfo.shared.isLogin {
+                if KMMemberInfo.shared.canTrail &&
+                    KMMemberInfo.shared.ai_productName == "" &&
+                    !IAPProductsManager.default().isAvailableAllFunction() &&
+                    !AIInfoManager.default().aiInfoValid {
+                    /** 1、临时邮箱已注册成新账户,未试用过,也未订阅AI;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能也未购买AI点数 */
+                    return .lite_type5  // 已登录(未试用过的免费用户+未订阅AI) -  无订阅+无AI旧剩余点数
+                } else if KMMemberInfo.shared.vip_status == 3 &&
+                            !IAPProductsManager.default().isAvailableAllFunction() &&
+                            oldAIPoints > 0 {
+                    /** 1、临时邮箱已注册成新账户,试用中试用到期且未付费;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能,有AI旧剩余点数 */
+                    return .lite_type6  // 已登录(试用到期且未付费用户+未订阅AI) -  无旧订阅+有AI旧剩余点数
+                } else if KMMemberInfo.shared.vip_levels == "3" &&
+                            KMMemberInfo.shared.vip_paymentModel == "2" &&
+                            KMMemberInfo.shared.vip_maxDeviceNum == 2 {
+                    /** 1、临时邮箱已注册成新账户,已付费Mac&Windows双平台高级版永久版;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能也未购买AI点数 */
+                    return .lite_type7  // 已登录(新的买断会员+有订阅AI) -  无旧订阅+无AI旧剩余点数
+                } else if KMMemberInfo.shared.vip_status == 3 &&
+                            KMMemberInfo.shared.vip_payType == 1 {
+                    /** 1、临时邮箱已注册成新账户,试用高级版年订阅并自动订阅中;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能,但有购买AI,有剩余点数 */
+                    return .lite_type8  // 已登录(自动订阅中 + 订阅AI) -  无旧订阅+有AI旧剩余点数
+                } else if KMMemberInfo.shared.vip_levels == "2" &&
+                            KMMemberInfo.shared.vip_cycle == 4 &&
+                            KMMemberInfo.shared.vip_paymentModel == "1" &&
+                            KMMemberInfo.shared.vip_payType == 0 {
+                    /** 1、临时邮箱已注册成新账户,已付费标准版年订阅并取消续订;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能也未购买AI点数 */
+                    return .lite_type9  // 已登录(订阅中但取消续订用户) -  无旧订阅+无AI旧剩余点数
+                } else if KMMemberInfo.shared.vip_levels == "2" &&
+                            KMMemberInfo.shared.vip_paymentModel == "2" &&
+                            KMMemberInfo.shared.vip_cycle == 4 &&
+                            KMMemberInfo.shared.vip_status == 2 {
+                    /** 1、临时邮箱已注册成新账户,已订阅标准版年订阅过期;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能也未购买AI点数 */
+                    return .lite_type10 // 已登录(订阅过期用户) -  无旧订阅+无AI旧剩余点数
+                } else if KMMemberInfo.shared.vip_status == 4 &&
+                            KMMemberInfo.shared.vip_levels == "1" {
+                    /** 1、临时邮箱已注册成新账户,已试用高级版年订阅并取消续订,当前试用过期;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能也未购买AI点数 */
+                    return .lite_type11 // 已登录(试用过期用户) -  无旧订阅+无AI旧剩余点数
+                }
+            } else {
+                if IAPProductsManager.default().isAvailableAllFunction() {
+                    if AIInfoManager.default().aiInfoValid {
+                        return .lite_type3  // 未登录 - 有订阅高级版+有AI序列码
+                    } else {
+                        return .lite_type4  // 未登录 - 有订阅高级版+无AI序列码
+                    }
+                } else {
+                    if AIInfoManager.default().aiInfoValid {
+                        return .lite_type2  // 未登录 - 无订阅 - 有AI
+                    } else {
+                        return .lite_type1  // 未登录 - 无订阅 - 无AI
+                    }
+                }
+            }
+#endif
+#else
+    // AppStore 付费版
+            if KMMemberInfo.shared.isLogin {
+                
+            } else {
+                
+            }
+#endif
+            return .null
+        }
+    }
+    
+    // 是否允许全部功能
+    var isMemberAllFunction: Bool {
+        get {
+            if KMMemberInfo.shared.isLogin {
+                if userScenarioType == .lite_type7 || userScenarioType == .lite_type8 || userScenarioType == .lite_type9 {
+                    return true
+                }
+                return false
+            } else {
+                if IAPProductsManager.default().isAvailableAllFunction() {
+                    return true
+                }
+                return false
+            }
+        }
+    }
+    
+    // 是否允许使用转档
+    var isPermitConvert: Bool {
+        if KMMemberInfo.shared.isLogin {
+            if userScenarioType == .lite_type7 || userScenarioType == .lite_type8 {
+                return true
+            }
+            return false
+        } else {
+            if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+                return true
+            }
+            return false
+        }
+    }
+    
+    // 是否允许使用AI
+    var isPermitAI: Bool {
+        let oldAIPoints = AIInfoManager.default().aiInfo.totalToken - AIInfoManager.default().aiInfo.usedTimes // 旧版AI点数
+        if KMMemberInfo.shared.isLogin {
+            if oldAIPoints > 0 {
+                return true
+            } else {
+                if userScenarioType == .lite_type6 || userScenarioType == .lite_type7 || userScenarioType == .lite_type8 {
+                    if KMMemberInfo.shared.aiPoint > 0 {
+                        return true
+                    } else {
+                        return false
+                    }
+                }
+                return false
+            }
+        } else {
+            if AIInfoManager.default().aiInfoValid && oldAIPoints > 0 {
+                return true
+            }
+            return false
+        }
+    }
+    
     // MARK: Public Method
     
     func memberUserInfo(model: KMMemberUserInfo) -> Void {
@@ -208,4 +360,42 @@ import Cocoa
         activeVips = model.activeVIP
         activeAis = model.activeAI
     }
+    
+    func advancedFunctionUsage() -> Void {
+        if userScenarioType == .lite_type1 || userScenarioType == .lite_type2 {
+            if KMMemberInfo.shared.isLogin {
+                KMProductCompareWC.shared.orientation = true
+                KMProductCompareWC.shared.orientationType = .trial
+                KMProductCompareWC.shared.showWindow(nil)
+            } else {
+                KMLoginWindowsController.shared.openWindow() { success in
+                    if success {
+                        KMProductCompareWC.shared.orientation = true
+                        KMProductCompareWC.shared.orientationType = .trial
+                        KMProductCompareWC.shared.showWindow(nil)
+                    }
+                }
+            }
+        } else if userScenarioType == .lite_type3 || userScenarioType == .lite_type4 {
+            
+        } else if userScenarioType == .lite_type5 {
+            KMProductCompareWC.shared.orientation = true
+            KMProductCompareWC.shared.orientationType = .trial
+            KMProductCompareWC.shared.showWindow(nil)
+        } else if userScenarioType == .lite_type6 {
+            KMProductCompareWC.shared.orientation = true
+            KMProductCompareWC.shared.orientationType = .lite_Base
+            KMProductCompareWC.shared.showWindow(nil)
+        } else if userScenarioType == .lite_type7 || userScenarioType == .lite_type8 || userScenarioType == .lite_type9  {
+            
+        } else if userScenarioType == .lite_type10 || userScenarioType == .lite_type11  {
+            KMProductCompareWC.shared.orientation = true
+            KMProductCompareWC.shared.orientationType = .lite_Base
+            KMProductCompareWC.shared.showWindow(nil)
+        }
+    }
+    
+    func aiSubscription() -> Void {
+        
+    }
 }

+ 1 - 0
PDF Office/PDF Master/MemberCenter/View/KMSignUpView.swift

@@ -374,6 +374,7 @@ class KMSignUpView: KMBaseXibView {
     
     @IBAction func stayCheckAction(_ sender: NSButton) {
         viewModel.stayState.toggle()
+        viewModel.stayStateAction()
     }
     
     @IBAction func signUpAction(_ sender: NSButton) {

+ 13 - 2
PDF Office/PDF Master/MemberCenter/ViewModel/KMSignUpViewModel.swift

@@ -13,6 +13,11 @@ import Combine
     case password               // 密码
 }
 
+@objc enum KMSuccessLoginJump : Int {
+    case null = 0   //
+    case compare    // 比较表
+}
+
 typealias ForgotPasswordComplete = (_ success: Bool,_ msg: String) -> Void
 
 @objcMembers
@@ -140,6 +145,13 @@ class KMSignUpViewModel: ObservableObject {
         return regex.firstMatch(in: verificationCode, options: [], range: NSRange(location: 0, length: verificationCode.utf16.count)) != nil
     }
     
+    func stayStateAction() -> Void {
+        if !stayState {
+            UserDefaults.standard.setValue("", forKey: "MemberAccessToken")
+            UserDefaults.standard.synchronize()
+        }
+    }
+    
     // MARK: Private Method
         
     /**
@@ -149,13 +161,12 @@ class KMSignUpViewModel: ObservableObject {
         KMUserInfoVCModel().refreshUserInfo { success, msg in
             if success {
                 KMMemberInfo.shared.isLogin = true
+                NotificationCenter.default.post(name: NSNotification.Name(rawValue: "MemberCenterLoginSuccess"), object: nil)
             } else {
                 KMMemberInfo.shared.isLogin = false
             }
         }
-        NotificationCenter.default.post(name: NSNotification.Name(rawValue: "MemberCenterLoginSuccess"), object: nil)
     }
-
         
     // MARK: Action Method
     

+ 12 - 0
PDF Office/PDF Master/MemberCenter/WindowsController/KMLoginWindowsController.swift

@@ -7,6 +7,8 @@
 
 import Cocoa
 
+typealias LoginResultComplete = (_ success: Bool) -> Void
+
 @objcMembers
 class KMLoginWindowsController: NSWindowController {
     
@@ -17,6 +19,8 @@ class KMLoginWindowsController: NSWindowController {
     
     var memberInfo: KMMemberInfo = KMMemberInfo.shared
     
+    var loginResult: LoginResultComplete!
+    
     static let shared: KMLoginWindowsController = {
         let windowC = KMLoginWindowsController(windowNibName: "KMLoginWindowsController")
         return windowC
@@ -53,7 +57,15 @@ class KMLoginWindowsController: NSWindowController {
     // MARK: public Action
     
     @objc func loginSuccessNotification() -> Void {
+        if let result = loginResult {
+            result(true)
+        }
         window?.close()
     }
     
+    func openWindow(_ complete: @escaping LoginResultComplete) -> Void {
+        KMLoginWindowsController.shared.showWindow(nil)
+        loginResult = complete
+    }
+    
 }

+ 15 - 30
PDF Office/PDF Master/MemberCenter/WindowsController/KMProductCompareWC.swift

@@ -139,6 +139,9 @@ class KMProductCompareWC: NSWindowController {
     private var model = KMProductModel()
     private var cancellables = Set<AnyCancellable>()
     
+    var orientation: Bool = false // 是否定向跳转
+    var orientationType: KMCompareTableType = .trial // 定向跳转比较表
+    
     static let shared: KMProductCompareWC = {
         let windowC = KMProductCompareWC(windowNibName: "KMProductCompareWC")
         return windowC
@@ -157,7 +160,7 @@ class KMProductCompareWC: NSWindowController {
 //      }
 
       convenience init() {
-          self.init(windowNibName: "KMPurchaseCompareWindowController")
+          self.init(windowNibName: "KMProductCompareWC")
           setupNotifications()
       }
 
@@ -227,18 +230,16 @@ class KMProductCompareWC: NSWindowController {
 
         // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
         bindViewModel()
-        model.getCurrentComparisonTableType()
+        if orientation {
+            model.state = orientationType
+        } else {
+            model.getCurrentComparisonTableType()
+        }
         languageLocalized()
         initializeUI()
 
-                
-//        value1InfoBox.fillColor = NSColor(red: 17/255, green: 6/255, blue: 143/255, alpha: 1)
         value1InfoLabel.stringValue = NSLocalizedString("6-Month Plan", comment: "")
-//        value3InfoLabel.stringValue = NSLocalizedString("Premium Version", comment: "")
-        
         value1InfoLabel.font = NSFont.UbuntuMediumFontWithSize(16)
-//        value3InfoLabel.font = NSFont.UbuntuMediumFontWithSize(16)
-    
         value1PurchaseButton.wantsLayer = true
         value1PurchaseButton.layer?.backgroundColor = NSColor(red: 1, green: 94/255, blue: 44/255, alpha: 1).cgColor
         value1PurchaseButton.layer?.cornerRadius = value1PurchaseButton.frame.height / 2
@@ -255,20 +256,8 @@ class KMProductCompareWC: NSWindowController {
         value2PurchaseButton.wantsLayer = true
         value2PurchaseButton.layer?.cornerRadius = value2PurchaseButton.frame.height / 2
         value2PurchaseLbl.stringValue = NSLocalizedString("Purchase", comment: "")
-        
-//        value2PurchaseButton.layer?.backgroundColor = NSColor.white.cgColor
-//        value2PurchaseLbl.textColor = NSColor(red: 85/255, green: 40/255, blue: 255/255, alpha: 1)
         self.value2PurchaseLbl.textColor = NSColor(red: 85/255, green: 40/255, blue: 255/255, alpha: 1)
         self.value2PurchaseButton.layer?.backgroundColor = NSColor.white.cgColor
-
-//        value3PurchaseButton.title = NSLocalizedString("Purchase", comment: "")
-//        value3PurchaseBtnLbl.stringValue = NSLocalizedString("Purchase", comment: "")
-//        value3PurchaseButton.wantsLayer = true
-//        value3PurchaseButton.setTitleColor(NSColor(red: 85/255, green: 40/255, blue: 255/255, alpha: 1))
-//        value3PurchaseBtnLbl.textColor = NSColor(red: 85/255, green: 40/255, blue: 255/255, alpha: 1)
-//        value3PurchaseButton.layer?.backgroundColor = NSColor.white.cgColor
-//        value3PurchaseButton.layer?.cornerRadius = value3PurchaseButton.frame.height / 2
-
         switchLabel.stringValue = NSLocalizedString("Choose your favorite payment and enjoy flexible upgrades.", comment: "")
         switchLabel.textColor = KMAppearance.Interactive.m0Color()
 //        switchButton.title = String(format: NSLocalizedString("Pricing and Plans", comment: ""))
@@ -388,7 +377,6 @@ class KMProductCompareWC: NSWindowController {
             value2PurchaseSubLabel.stringValue = NSLocalizedString("one-time purchase", comment: "")
             value2PurchaseSubLabel2.stringValue = NSLocalizedString("(Tax Incl.)", comment: "")
             value2PurchaseLabel.stringValue = model.getProductPrice(.allPlatformAdvanced_12)
-
         } else if model.state == .dmg_MacWindows {
             value2InfoLabel.stringValue = NSLocalizedString("PDF Reader Pro Advanced Annual Plan", comment: "")
             value2PurchaseSubLabel.stringValue = NSLocalizedString("Auto-renewal | Billed yearly", comment: "")
@@ -432,15 +420,14 @@ class KMProductCompareWC: NSWindowController {
     }
     
     private func initializeUI() -> Void {
-//        signUpLabel.textColor = NSColor(named: "FFFFFF") ?? NSColor.white
         btnRestore.setTitleColor(NSColor(named: "FFFFFF") ?? NSColor.white)
         btnRestore.font = NSFont.SFProTextRegularFont(13)
         btnRestore.mouseMoveCallback = { [weak self] mouseEntered in
             guard let self = self else { return }
             if mouseEntered {
-                btnRestore.setTitleColor(NSColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 0.7))
+                self.btnRestore.setTitleColor(NSColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 0.7))
             } else {
-                btnRestore.setTitleColor(NSColor(named: "FFFFFF") ?? NSColor.white)
+                self.btnRestore.setTitleColor(NSColor(named: "FFFFFF") ?? NSColor.white)
             }
         }
         privacyPolicyBtn.setTitleColor(NSColor(named: "FFFFFF") ?? NSColor.white)
@@ -448,9 +435,9 @@ class KMProductCompareWC: NSWindowController {
         privacyPolicyBtn.mouseMoveCallback = { [weak self] mouseEntered in
             guard let self = self else { return }
             if mouseEntered {
-                privacyPolicyBtn.setTitleColor(NSColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 0.7))
+                self.privacyPolicyBtn.setTitleColor(NSColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 0.7))
             } else {
-                privacyPolicyBtn.setTitleColor(NSColor(named: "FFFFFF") ?? NSColor.white)
+                self.privacyPolicyBtn.setTitleColor(NSColor(named: "FFFFFF") ?? NSColor.white)
             }
         }
         termOfSerBtn.setTitleColor(NSColor(named: "FFFFFF") ?? NSColor.white)
@@ -458,9 +445,9 @@ class KMProductCompareWC: NSWindowController {
         termOfSerBtn.mouseMoveCallback = { [weak self] mouseEntered in
             guard let self = self else { return }
             if mouseEntered {
-                termOfSerBtn.setTitleColor(NSColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 0.7))
+                self.termOfSerBtn.setTitleColor(NSColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 0.7))
             } else {
-                termOfSerBtn.setTitleColor(NSColor(named: "FFFFFF") ?? NSColor.white)
+                self.termOfSerBtn.setTitleColor(NSColor(named: "FFFFFF") ?? NSColor.white)
             }
         }
         
@@ -627,8 +614,6 @@ class KMProductCompareWC: NSWindowController {
         value3PurchaseSubLabel2.textColor = KMAppearance.Layout.w0Color()
         value4PurchaseSubLabel.textColor = KMAppearance.Layout.w0Color()
         value4PurchaseSubLabel2.textColor = KMAppearance.Layout.w0Color()
-//        value3PurchaseSubLabel.textColor = KMAppearance.Layout.w0Color()
-
     }
 
     @objc func reloadData() {

+ 0 - 1
PDF Office/PDF Master/PDF_Reader_Pro DMG-Bridging-Header.h

@@ -83,7 +83,6 @@
 #import "iVersion.h"
 #import "IAPProductsManager.h"
 #import "VerificationManager.h"
-#import "KMPurchaseCompareWindowController.h"
 #import "KMPurchaseCompareDMGWindowController.h"
 #import "KMVerificationWindowController.h"
 #import "KMVerificationMessageViewController.h"

+ 0 - 1
PDF Office/PDF Master/PDF_Reader_Pro Edition-Bridging-Header.h

@@ -79,7 +79,6 @@
 #import "iVersion.h"
 #import "IAPProductsManager.h"
 #import "VerificationManager.h"
-#import "KMPurchaseCompareWindowController.h"
 #import "KMPurchaseCompareDMGWindowController.h"
 #import "KMVerificationWindowController.h"
 #import "KMVerificationMessageViewController.h"

+ 0 - 1
PDF Office/PDF Master/PDF_Reader_Pro-Bridging-Header.h

@@ -79,7 +79,6 @@
 #import "iVersion.h"
 #import "IAPProductsManager.h"
 #import "VerificationManager.h"
-#import "KMPurchaseCompareWindowController.h"
 #import "KMPurchaseCompareDMGWindowController.h"
 #import "KMVerificationWindowController.h"
 #import "KMVerificationMessageViewController.h"