zmp-sdk 2.15.0-rc.2 → 2.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21454,468 +21454,292 @@
21454
21454
 
21455
21455
  const ACTION = {
21456
21456
  GET_DOWNLOADED_STICKER: {
21457
- name: 'action.get.downloaded.sticker',
21458
- version_live: { android: 0, iOS: 0 },
21459
- have_permission: false
21457
+ name: 'action.get.downloaded.sticker'
21460
21458
  },
21461
21459
  OPEN_SHARE_STICKER: {
21462
- name: 'action.open.share.sticker',
21463
- version_live: { android: 0, iOS: 0 },
21464
- have_permission: false
21460
+ name: 'action.open.share.sticker'
21465
21461
  },
21466
21462
  OPEN_PROFILE: {
21467
- name: 'action.open.profile',
21468
- version_live: { android: 0, iOS: 0 },
21469
- have_permission: false
21463
+ name: 'action.open.profile'
21470
21464
  },
21471
21465
  OPEN_FEED_DETAIL: {
21472
- name: 'action.open.feeddetail',
21473
- version_live: { android: 0, iOS: 0 },
21474
- have_permission: false
21466
+ name: 'action.open.feeddetail'
21475
21467
  },
21476
21468
  OPEN_FRIEND_RADA: {
21477
- name: 'action.open.friendrada',
21478
- version_live: { android: 0, iOS: 0 },
21479
- have_permission: false
21469
+ name: 'action.open.friendrada'
21480
21470
  },
21481
21471
  OPEN_INAPP: {
21482
- name: 'action.open.inapp',
21483
- version_live: { android: 0, iOS: 0 },
21484
- have_permission: false
21472
+ name: 'action.open.inapp'
21485
21473
  },
21486
21474
  OPEN_OUTAPP: {
21487
- name: 'action.open.outapp',
21488
- version_live: { android: 0, iOS: 0 },
21489
- have_permission: false
21475
+ name: 'action.open.outapp'
21490
21476
  },
21491
21477
  OPEN_PAGE: {
21492
- name: 'action.open.page',
21493
- version_live: { android: 0, iOS: 0 },
21494
- have_permission: false
21478
+ name: 'action.open.page'
21495
21479
  },
21496
21480
  OPEN_PHOTODETAIL: {
21497
- name: 'action.open.photodetail',
21498
- version_live: { android: 0, iOS: 0 },
21499
- have_permission: false
21481
+ name: 'action.open.photodetail'
21500
21482
  },
21501
21483
  OPEN_GALARY: {
21502
- name: 'action.open.galary',
21503
- version_live: { android: 0, iOS: 0 },
21504
- have_permission: false
21484
+ name: 'action.open.galary'
21505
21485
  },
21506
21486
  OPEN_GAMECENTER: {
21507
- name: 'action.open.gamecenter',
21508
- version_live: { android: 0, iOS: 0 },
21509
- have_permission: false
21487
+ name: 'action.open.gamecenter'
21510
21488
  },
21511
21489
  OPEN_GAMENEWS: {
21512
- name: 'action.open.gamenews',
21513
- version_live: { android: 0, iOS: 0 },
21514
- have_permission: false
21490
+ name: 'action.open.gamenews'
21515
21491
  },
21516
21492
  OPEN_TAB_CONTACT: {
21517
- name: 'action.open.tab.contact',
21518
- version_live: { android: 0, iOS: 0 },
21519
- have_permission: false
21493
+ name: 'action.open.tab.contact'
21520
21494
  },
21521
21495
  OPEN_TAB_SOCIAL: {
21522
- name: 'action.open.tab.social',
21523
- version_live: { android: 0, iOS: 0 },
21524
- have_permission: false
21496
+ name: 'action.open.tab.social'
21525
21497
  },
21526
21498
  OPEN_FRIENDSUGGEST: {
21527
- name: 'action.open.friendsuggest',
21528
- version_live: { android: 0, iOS: 0 },
21529
- have_permission: false
21499
+ name: 'action.open.friendsuggest'
21530
21500
  },
21531
21501
  OPEN_GROUPLIST: {
21532
- name: 'action.open.grouplist',
21533
- version_live: { android: 0, iOS: 0 },
21534
- have_permission: false
21502
+ name: 'action.open.grouplist'
21535
21503
  },
21536
21504
  OPEN_NEARBY: {
21537
- name: 'action.open.nearby',
21538
- version_live: { android: 0, iOS: 0 },
21539
- have_permission: false
21505
+ name: 'action.open.nearby'
21540
21506
  },
21541
21507
  OPEN_ROOM: {
21542
- name: 'action.open.room',
21543
- version_live: { android: 0, iOS: 0 },
21544
- have_permission: false
21508
+ name: 'action.open.room'
21545
21509
  },
21546
21510
  OPEN_STICKERSTORE: {
21547
- name: 'action.open.stickerstore',
21548
- version_live: { android: 0, iOS: 0 },
21549
- have_permission: false
21511
+ name: 'action.open.stickerstore'
21550
21512
  },
21551
21513
  OPEN_CREATECHAT: {
21552
- name: 'action.open.createchat',
21553
- version_live: { android: 0, iOS: 0 },
21554
- have_permission: false
21514
+ name: 'action.open.createchat'
21555
21515
  },
21556
21516
  COPY_LINK_CATESTICKER: {
21557
- name: 'action.copy.link.catesticker',
21558
- version_live: { android: 0, iOS: 0 },
21559
- have_permission: false
21517
+ name: 'action.copy.link.catesticker'
21560
21518
  },
21561
21519
  REQUEST_BUY_STICKER: {
21562
- name: 'action.request.buy.sticker',
21563
- version_live: { android: 0, iOS: 0 },
21564
- have_permission: false
21520
+ name: 'action.request.buy.sticker'
21565
21521
  },
21566
21522
  OPEN_CHAT: {
21567
- name: 'action.open.chat',
21568
- version_live: { android: 0, iOS: 0 },
21569
- have_permission: false
21523
+ name: 'action.open.chat'
21570
21524
  },
21571
21525
  OPEN_TAB_CHAT: {
21572
- name: 'action.open.tab.chat',
21573
- version_live: { android: 0, iOS: 0 },
21574
- have_permission: false
21526
+ name: 'action.open.tab.chat'
21575
21527
  },
21576
21528
  OPEN_CHATGROUP: {
21577
- name: 'action.open.chatgroup',
21578
- version_live: { android: 0, iOS: 0 },
21579
- have_permission: false
21529
+ name: 'action.open.chatgroup'
21580
21530
  },
21581
21531
  OPEN_ADDFRIEND: {
21582
- name: 'action.open.addfriend',
21583
- version_live: { android: 0, iOS: 0 },
21584
- have_permission: false
21532
+ name: 'action.open.addfriend'
21585
21533
  },
21586
21534
  OPEN_TAB_MORE: {
21587
- name: 'action.open.tab.more',
21588
- version_live: { android: 0, iOS: 0 },
21589
- have_permission: false
21535
+ name: 'action.open.tab.more'
21590
21536
  },
21591
21537
  OPEN_POSTFEED: {
21592
- name: 'action.open.postfeed',
21593
- version_live: { android: 0, iOS: 0 },
21594
- have_permission: false
21538
+ name: 'action.open.postfeed'
21595
21539
  },
21596
21540
  OPEN_LOGINDEVICES: {
21597
- name: 'action.open.logindevices',
21598
- version_live: { android: 0, iOS: 0 },
21599
- have_permission: false
21541
+ name: 'action.open.logindevices'
21600
21542
  },
21601
21543
  OPEN_SENDSTICKER: {
21602
- name: 'action.open.sendsticker',
21603
- version_live: { android: 0, iOS: 0 },
21604
- have_permission: false
21544
+ name: 'action.open.sendsticker'
21605
21545
  },
21606
21546
  REPORT_ABUSE: {
21607
- name: 'action.report.abuse',
21608
- version_live: { android: 0, iOS: 0 },
21609
- have_permission: false
21547
+ name: 'action.report.abuse'
21610
21548
  },
21611
21549
  FOLLOW_OA: {
21612
- name: 'action.follow.oa',
21613
- version_live: { android: 0, iOS: 0 },
21614
- have_permission: false
21550
+ name: 'action.follow.oa'
21615
21551
  },
21616
21552
  UNFOLLOW_OA: {
21617
- name: 'action.unfollow.oa',
21618
- version_live: { android: 0, iOS: 0 },
21619
- have_permission: false
21553
+ name: 'action.unfollow.oa'
21620
21554
  },
21621
21555
  OPEN_GAMEDETAIL: {
21622
- name: 'action.open.gamedetail',
21623
- version_live: { android: 0, iOS: 0 },
21624
- have_permission: false
21556
+ name: 'action.open.gamedetail'
21625
21557
  },
21626
21558
  OPEN_SHARESHEET: {
21627
- name: 'action.open.sharesheet',
21628
- version_live: { android: 0, iOS: 0 },
21629
- have_permission: false
21559
+ name: 'action.open.sharesheet'
21630
21560
  },
21631
21561
  REQUEST_PERMISSION_CAMERA: {
21632
- name: 'action.request.permission.camera',
21633
- version_live: { android: 0, iOS: 0 },
21634
- have_permission: false
21562
+ name: 'action.request.permission.camera'
21635
21563
  },
21636
21564
  CHANGE_TITLE_HEADER: {
21637
21565
  name: 'action.change.title.header',
21638
- version_live: { android: 0, iOS: 0 },
21639
- have_permission: false,
21640
21566
  skip_jump: true
21641
21567
  },
21642
21568
  WEBVIEW_CLEARCACHE: {
21643
- name: 'action.webview.clearcache',
21644
- version_live: { android: 0, iOS: 0 },
21645
- have_permission: false
21569
+ name: 'action.webview.clearcache'
21646
21570
  },
21647
21571
  WEBVIEW_CONFIRMCACHE: {
21648
- name: 'action.webview.confirmcache',
21649
- version_live: { android: 0, iOS: 0 },
21650
- have_permission: false
21572
+ name: 'action.webview.confirmcache'
21651
21573
  },
21652
21574
  WEBVIEW_ISVISIBLE: {
21653
- name: 'action.webview.isvisible',
21654
- version_live: { android: 0, iOS: 0 },
21655
- have_permission: false
21575
+ name: 'action.webview.isvisible'
21656
21576
  },
21657
21577
  WEBVIEW_NETWORKTYPE: {
21658
21578
  name: 'action.webview.networktype',
21659
- version_live: { android: 0, iOS: 0 },
21660
- have_permission: false,
21661
21579
  skip_jump: true
21662
21580
  },
21663
21581
  CHANGE_BUTTON_HEADER: {
21664
- name: 'action.change.button.header',
21665
- version_live: { android: 0, iOS: 0 },
21666
- have_permission: false
21582
+ name: 'action.change.button.header'
21667
21583
  },
21668
21584
  CREATE_OPTIONS_MENU: {
21669
21585
  name: 'action.create.options.menu',
21670
- version_live: { android: 0, iOS: 0 },
21671
- have_permission: false,
21672
21586
  skip_jump: true
21673
21587
  },
21674
21588
  CREATE_SHORTCUT: {
21675
- name: 'action.create.shortcut',
21676
- version_live: { android: 0, iOS: 0 },
21677
- have_permission: false
21589
+ name: 'action.create.shortcut'
21678
21590
  },
21679
21591
  CHANGE_ACTIONBAR_LEFTBUTTON_TYPE: {
21680
21592
  name: 'action.change.actionbar.leftbutton.type',
21681
- version_live: { android: 0, iOS: 0 },
21682
- have_permission: false,
21683
21593
  skip_jump: true
21684
21594
  },
21685
21595
  WINDOW_CLOSE: {
21686
21596
  name: 'action.window.close',
21687
- version_live: { android: 0, iOS: 0 },
21688
- have_permission: false,
21689
21597
  skip_jump: true
21690
21598
  },
21691
21599
  WEBVIEW_CHECKRESERROR: {
21692
- name: 'action.webview.checkResError',
21693
- version_live: { android: 0, iOS: 0 },
21694
- have_permission: false
21600
+ name: 'action.webview.checkResError'
21695
21601
  },
21696
21602
  IAP_REQUESTPAYMENT: {
21697
- name: 'action.iap.requestpayment',
21698
- version_live: { android: 0, iOS: 0 },
21699
- have_permission: false
21603
+ name: 'action.iap.requestpayment'
21700
21604
  },
21701
21605
  ZBROWSER_GETSTATS: {
21702
- name: 'action.zbrowser.getstats',
21703
- version_live: { android: 0, iOS: 0 },
21704
- have_permission: false
21606
+ name: 'action.zbrowser.getstats'
21705
21607
  },
21706
21608
  ZBROWSER_JSBRIDGE: {
21707
21609
  name: 'action.zbrowser.jsbridge',
21708
- version_live: { android: 0, iOS: 0 },
21709
- have_permission: false,
21710
21610
  skip_jump: true
21711
21611
  },
21712
21612
  PROMPT_AUTHENTICATION: {
21713
- name: 'action.prompt.authentication',
21714
- version_live: { android: 0, iOS: 0 },
21715
- have_permission: false
21613
+ name: 'action.prompt.authentication'
21716
21614
  },
21717
21615
  CHANGE_ACTIONBAR_COLOR: {
21718
21616
  name: 'action.change.actionbar.color',
21719
- version_live: { android: 0, iOS: 0 },
21720
- have_permission: false,
21721
21617
  skip_jump: true
21722
21618
  },
21723
21619
  PROMPT_AUTHENTICATION_CHECK_STATE: {
21724
- name: 'action.prompt.authentication.check_state',
21725
- version_live: { android: 0, iOS: 0 },
21726
- have_permission: false
21620
+ name: 'action.prompt.authentication.check_state'
21727
21621
  },
21728
21622
  OPEN_APPSTORE: {
21729
- name: 'action.open.appstore',
21730
- version_live: { android: 0, iOS: 0 },
21731
- have_permission: false
21623
+ name: 'action.open.appstore'
21732
21624
  },
21733
21625
  GET_LOCATION: {
21734
- name: 'action.get.location',
21735
- version_live: { android: 0, iOS: 0 },
21736
- have_permission: false
21626
+ name: 'action.get.location'
21737
21627
  },
21738
21628
  QUERY_LOCATION_HIDE: {
21739
- name: 'action.query.location.hide',
21740
- version_live: { android: 0, iOS: 0 },
21741
- have_permission: false
21629
+ name: 'action.query.location.hide'
21742
21630
  },
21743
21631
  SHOW_TOAST: {
21744
- name: 'action.show.toast',
21745
- version_live: { android: 0, iOS: 0 },
21746
- have_permission: false
21632
+ name: 'action.show.toast'
21747
21633
  },
21748
21634
  OPEN_APP: {
21749
- name: 'action.open.app',
21750
- version_live: { android: 0, iOS: 0 },
21751
- have_permission: false
21635
+ name: 'action.open.app'
21752
21636
  },
21753
21637
  HIDE_KEYBOARD: {
21754
- name: 'action.hide.keyboard',
21755
- version_live: { android: 0, iOS: 0 },
21756
- have_permission: false
21638
+ name: 'action.hide.keyboard'
21757
21639
  },
21758
21640
  OPEN_PHONE: {
21759
- name: 'action.open.phone',
21760
- version_live: { android: 0, iOS: 0 },
21761
- have_permission: false
21641
+ name: 'action.open.phone'
21762
21642
  },
21763
21643
  OPEN_QR: {
21764
- name: 'action.open.qr',
21765
- version_live: { android: 0, iOS: 0 },
21766
- have_permission: false
21644
+ name: 'action.open.qr'
21767
21645
  },
21768
21646
  OPEN_SMS: {
21769
- name: 'action.open.sms',
21770
- version_live: { android: 0, iOS: 0 },
21771
- have_permission: false
21647
+ name: 'action.open.sms'
21772
21648
  },
21773
21649
  VIEW_MYQR: {
21774
- name: 'action.view.myqr',
21775
- version_live: { android: 0, iOS: 0 },
21776
- have_permission: false
21650
+ name: 'action.view.myqr'
21777
21651
  },
21778
21652
  KEEP_SCREEN: {
21779
- name: 'action.keep.screen',
21780
- version_live: { android: 0, iOS: 0 },
21781
- have_permission: false
21653
+ name: 'action.keep.screen'
21782
21654
  },
21783
21655
  CHANGE_AUTOROTATE: {
21784
21656
  name: 'action.change.autorotate',
21785
- version_live: { android: 0, iOS: 0 },
21786
- have_permission: false,
21787
21657
  skip_jump: true
21788
21658
  },
21789
21659
  CHECK_APP_INSTALLED: {
21790
- name: 'action.check.app.installed',
21791
- version_live: { android: 0, iOS: 0 },
21792
- have_permission: false
21660
+ name: 'action.check.app.installed'
21793
21661
  },
21794
21662
  QUERY_SHOW: {
21795
- name: 'action.query.show',
21796
- version_live: { android: 0, iOS: 0 },
21797
- have_permission: false
21663
+ name: 'action.query.show'
21798
21664
  },
21799
21665
  QUERY_HIDE: {
21800
- name: 'action.query.hide',
21801
- version_live: { android: 0, iOS: 0 },
21802
- have_permission: false
21666
+ name: 'action.query.hide'
21803
21667
  },
21804
21668
  OPEN_INAPPRW: {
21805
- name: 'action.open.inapprw',
21806
- version_live: { android: 0, iOS: 0 },
21807
- have_permission: false
21669
+ name: 'action.open.inapprw'
21808
21670
  },
21809
21671
  ZALORUN_GETTRACKINGSTATUS: {
21810
- name: 'action.zalorun.getTrackingStatus',
21811
- version_live: { android: 0, iOS: 0 },
21812
- have_permission: false
21672
+ name: 'action.zalorun.getTrackingStatus'
21813
21673
  },
21814
21674
  ZALORUN_SETTRACKINGSTATUS: {
21815
- name: 'action.zalorun.setTrackingStatus',
21816
- version_live: { android: 0, iOS: 0 },
21817
- have_permission: false
21675
+ name: 'action.zalorun.setTrackingStatus'
21818
21676
  },
21819
21677
  ZALORUN_GETDAYSTEP: {
21820
- name: 'action.zalorun.getDayStep',
21821
- version_live: { android: 0, iOS: 0 },
21822
- have_permission: false
21678
+ name: 'action.zalorun.getDayStep'
21823
21679
  },
21824
21680
  ZALORUN_FORCESUBMITDATA: {
21825
- name: 'action.zalorun.forceSubmitData',
21826
- version_live: { android: 0, iOS: 0 },
21827
- have_permission: false
21681
+ name: 'action.zalorun.forceSubmitData'
21828
21682
  },
21829
21683
  ZALORUN_SETWEIGHT: {
21830
- name: 'action.zalorun.setWeight',
21831
- version_live: { android: 0, iOS: 0 },
21832
- have_permission: false
21684
+ name: 'action.zalorun.setWeight'
21833
21685
  },
21834
21686
  OPEN_PROFILE_EXT: {
21835
- name: 'action.open.profile.ext',
21836
- version_live: { android: 0, iOS: 0 },
21837
- have_permission: false
21687
+ name: 'action.open.profile.ext'
21838
21688
  },
21839
21689
  DOWNLOAD_CATE: {
21840
- name: 'action.download.cate',
21841
- version_live: { android: 0, iOS: 0 },
21842
- have_permission: false
21690
+ name: 'action.download.cate'
21843
21691
  },
21844
21692
  JUMP_LOGIN: {
21845
21693
  name: 'action.jump.login',
21846
- version_live: { android: 0, iOS: 0 },
21847
- have_permission: false,
21848
21694
  skip_jump: true,
21849
21695
  white_list: true
21850
21696
  },
21851
21697
  OPEN_ADTIMA_ADS_INTERSTITIAL: {
21852
- name: 'action.open.adtima.ads.interstitial',
21853
- version_live: { android: 0, iOS: 0 },
21854
- have_permission: false
21698
+ name: 'action.open.adtima.ads.interstitial'
21855
21699
  },
21856
21700
  OPEN_ADTIMA_ADS: {
21857
- name: 'action.open.adtima.ads',
21858
- version_live: { android: 0, iOS: 0 },
21859
- have_permission: false
21701
+ name: 'action.open.adtima.ads'
21860
21702
  },
21861
21703
  GET_ADIDCLIENT: {
21862
- name: 'action.get.adidclient',
21863
- version_live: { android: 0, iOS: 0 },
21864
- have_permission: false
21704
+ name: 'action.get.adidclient'
21865
21705
  },
21866
21706
  SCAN_IBEACON: {
21867
- name: 'action.scan.ibeacon',
21868
- version_live: { android: 0, iOS: 0 },
21869
- have_permission: false
21707
+ name: 'action.scan.ibeacon'
21708
+ },
21709
+ INTERACTIVE_VIBRATION: {
21710
+ name: 'action.interactive.vibration'
21870
21711
  },
21871
21712
  SAVE_IMAGE_GALLERY: {
21872
21713
  name: 'action.save.image.gallery',
21873
- version_live: { android: 576, iOS: 408 },
21874
- have_permission: false
21714
+ version_live: { iOS: 408 }
21875
21715
  },
21876
21716
  OPEN_MP: {
21877
21717
  name: 'action.open.mp',
21878
- version_live: { android: 576, iOS: 402 },
21879
- have_permission: false
21718
+ version_live: { iOS: 402 }
21880
21719
  },
21881
21720
  CHANGE_ACTIONBAR: {
21882
21721
  name: 'action.change.actionbar',
21883
- version_live: { android: 0, iOS: 402 },
21884
- have_permission: false,
21722
+ version_live: { iOS: 402 },
21885
21723
  skip_jump: true
21886
21724
  },
21887
- INTERACTIVE_VIBRATION: {
21888
- name: 'action.interactive.vibration',
21889
- version_live: { android: 0, iOS: 0 },
21890
- have_permission: false
21891
- },
21892
21725
  ZBROWSER_MPDS: {
21893
21726
  name: 'action.zbrowser.mpds',
21894
- version_live: { android: 576, iOS: 402 },
21895
- have_permission: false
21727
+ version_live: { iOS: 402 }
21896
21728
  },
21897
21729
  WEBVIEW_SET_RESULT: {
21898
21730
  name: 'action.webview.set.result',
21899
- version_live: { android: 589, iOS: 416 },
21900
- have_permission: false
21731
+ version_live: { iOS: 416 }
21901
21732
  },
21902
21733
  MP_GET_NUMBER: {
21903
21734
  name: 'action.mp.get.number',
21904
- version_live: { android: 589, iOS: 416 },
21905
- have_permission: false
21735
+ version_live: { iOS: 416 }
21906
21736
  },
21907
21737
  MP_OPEN_PROFILE_PICKER: {
21908
21738
  name: 'action.mp.open.profile.picker',
21909
- version_live: {
21910
- android: 999,
21911
- iOS: 999
21912
- },
21913
- have_permission: false
21739
+ version_live: { iOS: 999 }
21914
21740
  },
21915
21741
  GET_SUPPORTED_ACTIONS: {
21916
21742
  name: 'action.get.supported.actions',
21917
- version_live: { android: 0, iOS: 0 },
21918
- have_permission: false,
21919
21743
  white_list: true
21920
21744
  }
21921
21745
  };
@@ -22283,6 +22107,18 @@
22283
22107
  debug$2('parse json error:', error);
22284
22108
  return data;
22285
22109
  }
22110
+ };
22111
+ const checkIOSSupportAction = (action) => {
22112
+ var _a, _b;
22113
+ const key = action.slice(7, action.length).replace(/\./gi, '_').toUpperCase();
22114
+ const zaloIOSVersion = getZaloVersion();
22115
+ const actionVersionLive = ((_b = (_a = ACTION[key]) === null || _a === void 0 ? void 0 : _a.version_live) === null || _b === void 0 ? void 0 : _b.iOS) || 0;
22116
+ if (Array.isArray(window.ignoreCheckSupport) &&
22117
+ window.ignoreCheckSupport.length > 0 &&
22118
+ window.ignoreCheckSupport.includes(action)) {
22119
+ return true;
22120
+ }
22121
+ return zaloIOSVersion >= actionVersionLive;
22286
22122
  };
22287
22123
 
22288
22124
  /*! *****************************************************************************
@@ -36124,14 +35960,14 @@
36124
35960
 
36125
35961
  var axios = axios_1;
36126
35962
 
36127
- var CONT = (() => {
35963
+ var CONFIG = (() => {
36128
35964
  const Byte = 1;
36129
35965
  const KB = 1024 * Byte;
36130
35966
  const MB = 1024 * KB;
36131
35967
  const device = checkPlatform();
36132
35968
  return {
36133
- MINI_APP_LINK: "https://zalo.me/app/link/zapps",
36134
- MINI_APP_INTERNAL_LINK: "https://h5.zdn.vn/zapps",
35969
+ MINI_APP_LINK: 'https://zalo.me/app/link/zapps',
35970
+ MINI_APP_INTERNAL_LINK: 'https://h5.zdn.vn/zapps',
36135
35971
  COOKIE_NAME: {
36136
35972
  ZOAUTH: `h5.zdn.vn_zoauth`,
36137
35973
  ZACC_SESSiON: `h5.zdn.vn_zacc_session`,
@@ -36139,7 +35975,9 @@
36139
35975
  ZOAUTH_VRF: `h5.zdn.vn_zoauth_vrf`
36140
35976
  },
36141
35977
  APIS: {
36142
- GET_USER_INFO: 'https://graph.zalo.me/v2.0/me'
35978
+ GET_USER_INFO: 'https://graph.zalo.me/v2.0/me',
35979
+ GET_ACCESS_TOKEN: 'https://h5.zalo.me/openapi/access_token',
35980
+ GET_ACCESS_TOKEN_V3: 'https://oauth.zaloapp.com/v3/access_token'
36143
35981
  },
36144
35982
  STORAGE_DATA_LIMIT: 100 * KB,
36145
35983
  STORAGE_LIMIT: 5 * MB,
@@ -36724,52 +36562,10 @@
36724
36562
  catch (error) {
36725
36563
  return reject(error);
36726
36564
  }
36727
- // if (cb && cb.error_code >= 0 && cb.action == action) {
36728
- // resolve(cb.data || {});
36729
- // if (option?.callback) {
36730
- // try {
36731
- // await option.callback(cb, null);
36732
- // } catch (error) {
36733
- // reject(error);
36734
- // }
36735
- // }
36736
- // } else if (cb && cb.error_code < 0) {
36737
- // const error = new NativeError(
36738
- // cb.error_code,
36739
- // `${cb.action}: ${cb.error_message}`
36740
- // );
36741
- // try {
36742
- // window.zmpSentry &&
36743
- // window.zmpSentry.captureMessage(`${action}: call native fail`, {
36744
- // extra: {
36745
- // data: data,
36746
- // rs: cb
36747
- // }
36748
- // });
36749
- // } catch (error) {}
36750
- // if (option?.callback) {
36751
- // try {
36752
- // await option.callback(cb, error);
36753
- // } catch (error) {
36754
- // reject(error);
36755
- // }
36756
- // } else {
36757
- // reject(error);
36758
- // }
36759
- // }
36760
36565
  });
36761
- const key = action
36762
- .slice(7, action.length)
36763
- .replace(/\./gi, '_')
36764
- .toUpperCase();
36765
- const isAndroid = checkPlatform().isAndroid;
36766
- const zaloVersion = isAndroid
36767
- ? getZaloVersion() % 100000
36768
- : getZaloVersion();
36769
- const isSupportAction = isAndroid
36770
- ? zaloVersion >= ACTION[key].version_live.android
36771
- : zaloVersion >= ACTION[key].version_live.iOS;
36772
- if (!isSupportAction) {
36566
+ const isIOS = checkPlatform().isIOS;
36567
+ const isSupportAction = checkIOSSupportAction(action);
36568
+ if (isIOS && !isSupportAction) {
36773
36569
  const error = new NativeError(-5, `${action}: Client isn't support this action`);
36774
36570
  return reject(error);
36775
36571
  }
@@ -36793,7 +36589,7 @@
36793
36589
  }
36794
36590
  };
36795
36591
 
36796
- var version = "2.15.0-rc.2";
36592
+ var version = "2.15.0";
36797
36593
 
36798
36594
  class Basics {
36799
36595
  /**
@@ -36974,7 +36770,7 @@
36974
36770
  dataConfig: dataConfig,
36975
36771
  homeConfig: {
36976
36772
  enable: this.isShowHomeButton ? 1 : 0,
36977
- url: `${CONT.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/`
36773
+ url: `${CONFIG.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/`
36978
36774
  }
36979
36775
  }, {
36980
36776
  haveTimeout: false
@@ -37042,7 +36838,7 @@
37042
36838
  },
37043
36839
  homeConfig: {
37044
36840
  enable: 0,
37045
- url: `${CONT.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/`
36841
+ url: `${CONFIG.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/`
37046
36842
  }
37047
36843
  };
37048
36844
  break;
@@ -37055,7 +36851,7 @@
37055
36851
  },
37056
36852
  homeConfig: {
37057
36853
  enable: 0,
37058
- url: `${CONT.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/`
36854
+ url: `${CONFIG.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/`
37059
36855
  }
37060
36856
  };
37061
36857
  break;
@@ -37068,7 +36864,7 @@
37068
36864
  },
37069
36865
  homeConfig: {
37070
36866
  enable: 1,
37071
- url: `${CONT.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/`
36867
+ url: `${CONFIG.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/`
37072
36868
  }
37073
36869
  };
37074
36870
  break;
@@ -37081,7 +36877,7 @@
37081
36877
  },
37082
36878
  homeConfig: {
37083
36879
  enable: 1,
37084
- url: `${CONT.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/`
36880
+ url: `${CONFIG.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/`
37085
36881
  }
37086
36882
  };
37087
36883
  break;
@@ -37307,19 +37103,19 @@
37307
37103
  const network = data.network;
37308
37104
  let networkType;
37309
37105
  switch (network) {
37310
- case CONT.NETWORK_TYPE.NONE:
37106
+ case CONFIG.NETWORK_TYPE.NONE:
37311
37107
  networkType = NetworkType.none;
37312
37108
  break;
37313
- case CONT.NETWORK_TYPE.WIFI:
37109
+ case CONFIG.NETWORK_TYPE.WIFI:
37314
37110
  networkType = NetworkType.wifi;
37315
37111
  break;
37316
- case CONT.NETWORK_TYPE['2G']:
37112
+ case CONFIG.NETWORK_TYPE['2G']:
37317
37113
  networkType = NetworkType.cellular;
37318
37114
  break;
37319
- case CONT.NETWORK_TYPE['3G']:
37115
+ case CONFIG.NETWORK_TYPE['3G']:
37320
37116
  networkType = NetworkType.cellular;
37321
37117
  break;
37322
- case CONT.NETWORK_TYPE['4G']:
37118
+ case CONFIG.NETWORK_TYPE['4G']:
37323
37119
  networkType = NetworkType.cellular;
37324
37120
  break;
37325
37121
  default:
@@ -37842,7 +37638,7 @@
37842
37638
  __classPrivateFieldSet(this, _LocalResourceStorage_resourceInfo, {
37843
37639
  keys: new Set(),
37844
37640
  currentSize: 0,
37845
- limitSize: CONT.STORAGE_LIMIT
37641
+ limitSize: CONFIG.STORAGE_LIMIT
37846
37642
  });
37847
37643
  __classPrivateFieldSet(this, _LocalResourceStorage_prefix, prefix);
37848
37644
  this.findAllCurrentDataByApp(prefix);
@@ -37905,7 +37701,7 @@
37905
37701
  currentSize: lodash.isNumber(currentSize)
37906
37702
  ? Number((currentSize / 1024).toFixed(2))
37907
37703
  : 0,
37908
- limitSize: Number((CONT.STORAGE_LIMIT / 1024).toFixed(2))
37704
+ limitSize: Number((CONFIG.STORAGE_LIMIT / 1024).toFixed(2))
37909
37705
  };
37910
37706
  }
37911
37707
  remove(keys) {
@@ -37951,7 +37747,7 @@
37951
37747
  __classPrivateFieldSet(this, _NativeResourceStorage_resourceInfo, {
37952
37748
  keys: new Set(),
37953
37749
  currentSize: 0,
37954
- limitSize: CONT.STORAGE_LIMIT
37750
+ limitSize: CONFIG.STORAGE_LIMIT
37955
37751
  });
37956
37752
  __classPrivateFieldSet(this, _NativeResourceStorage_appId, appId);
37957
37753
  }
@@ -38011,7 +37807,7 @@
38011
37807
  });
38012
37808
  return {
38013
37809
  currentSize: lodash.isNumber(currentSize) ? Number(currentSize / 1024) : 0,
38014
- limitSize: Number(CONT.STORAGE_LIMIT / 1024)
37810
+ limitSize: Number(CONFIG.STORAGE_LIMIT / 1024)
38015
37811
  };
38016
37812
  });
38017
37813
  }
@@ -38267,7 +38063,7 @@
38267
38063
  fields = `${fields}.type(${object === null || object === void 0 ? void 0 : object.avatarType})`;
38268
38064
  }
38269
38065
  const userInfo = yield axios
38270
- .get(CONT.APIS.GET_USER_INFO, {
38066
+ .get(CONFIG.APIS.GET_USER_INFO, {
38271
38067
  params: {
38272
38068
  fields: fields,
38273
38069
  access_token: accessToken
@@ -38350,7 +38146,7 @@
38350
38146
  })
38351
38147
  .join('&');
38352
38148
  yield this.callNative(ACTION.OPEN_MP.name, {
38353
- mpUrl: `${CONT.MINI_APP_INTERNAL_LINK}/${appId}/${queryParamString.length > 0 ? '?' + queryParamString : ''}`,
38149
+ mpUrl: `${CONFIG.MINI_APP_INTERNAL_LINK}/${appId}/${queryParamString.length > 0 ? '?' + queryParamString : ''}`,
38354
38150
  mpInfo: {
38355
38151
  appId: appId
38356
38152
  }
@@ -38668,10 +38464,16 @@
38668
38464
  case 'zmp':
38669
38465
  const currentUrl = new URL(location.href);
38670
38466
  const params = new URLSearchParams();
38467
+ const accessToken = yield this.getAccessToken();
38671
38468
  const description = {
38672
38469
  vi: '',
38673
38470
  en: ''
38674
38471
  };
38472
+ let path = `${currentUrl.pathname}${currentUrl.search}`;
38473
+ if (object.data.path) {
38474
+ path = `/zapps/${this.getAppId()}${object.data.path[0] === '/' ? '' : '/'}${object.data.path}`;
38475
+ }
38476
+ const validUrl = new URL(`https://zalo.me/app/link${path}`);
38675
38477
  if (lodash.isString(object.data.description)) {
38676
38478
  description.en = description.vi = object.data.description;
38677
38479
  }
@@ -38682,13 +38484,14 @@
38682
38484
  params.append('title', object.data.title);
38683
38485
  params.append('description', description.vi || description.en);
38684
38486
  params.append('thumbnail', object.data.thumbnail);
38685
- params.append('url', `https://zalo.me/app/link${currentUrl.pathname}${currentUrl.search}`);
38686
- const config = {
38487
+ params.append('url', validUrl.href);
38488
+ params.append('accessToken', accessToken || '');
38489
+ const postConfig = {
38687
38490
  headers: {
38688
38491
  'Content-Type': 'application/x-www-form-urlencoded'
38689
38492
  }
38690
38493
  };
38691
- const res = yield axios.post('https://h5.zalo.me/openapi/create-sharelink', params, config);
38494
+ const res = yield axios.post('https://h5.zalo.me/openapi/create-sharelink', params, postConfig);
38692
38495
  const resData = res.data;
38693
38496
  if (!resData || resData.err !== 0) {
38694
38497
  throw apiResponse.error.cannotGetShareInfo();
@@ -38697,8 +38500,9 @@
38697
38500
  const platform = checkPlatform();
38698
38501
  if ((platform.isAndroid && zaloVersion % 100000 <= 593) ||
38699
38502
  (platform.isIOS && zaloVersion <= 424)) {
38503
+ validUrl.search = `${validUrl.search}&zshareId=${resData.data.shareId}`;
38700
38504
  reqData = {
38701
- link: `${resData.data.shareUrl}`,
38505
+ link: validUrl.href,
38702
38506
  chatOnly: object.data.chatOnly ? 1 : 0
38703
38507
  };
38704
38508
  object.type = 'link';
@@ -38743,7 +38547,7 @@
38743
38547
  static createShortcut(object) {
38744
38548
  return __awaiter(this, void 0, void 0, function* () {
38745
38549
  yield this.callNative(ACTION.CREATE_SHORTCUT.name, {
38746
- url: `${CONT.MINI_APP_LINK}/${this.getAppId()}/`,
38550
+ url: `${CONFIG.MINI_APP_LINK}/${this.getAppId()}/`,
38747
38551
  title: document.title,
38748
38552
  iconUrl: `https:${getMetaValue('og:image:url')}`
38749
38553
  });
@@ -38867,7 +38671,7 @@
38867
38671
  }
38868
38672
  }
38869
38673
 
38870
- var _ZaloMiniProgramSDK_zAppId, _ZaloMiniProgramSDK_appId, _ZaloMiniProgramSDK_appConfig, _ZaloMiniProgramSDK_zOAuth, _ZaloMiniProgramSDK_zOAuthVrf, _ZaloMiniProgramSDK_firstLogin, _ZaloMiniProgramSDK_accessToken, _ZaloMiniProgramSDK_refreshToken, _ZaloMiniProgramSDK_cache, _ZaloMiniProgramSDK_loggedIn, _ZaloMiniProgramSDK_prevGetTokenTimestamp, _ZaloMiniProgramSDK_tokenExpiresIn, _ZaloMiniProgramSDK_configWindow, _ZaloMiniProgramSDK_configApp, _ZaloMiniProgramSDK_callJump, _ZaloMiniProgramSDK_setNavigationBarRightButton, _ZaloMiniProgramSDK_getActionsSupported;
38674
+ var _ZaloMiniProgramSDK_zAppId, _ZaloMiniProgramSDK_appId, _ZaloMiniProgramSDK_appConfig, _ZaloMiniProgramSDK_zOAuth, _ZaloMiniProgramSDK_zOAuthVrf, _ZaloMiniProgramSDK_accessToken, _ZaloMiniProgramSDK_refreshToken, _ZaloMiniProgramSDK_cache, _ZaloMiniProgramSDK_prevGetTokenTimestamp, _ZaloMiniProgramSDK_tokenExpiresIn, _ZaloMiniProgramSDK_cookies, _ZaloMiniProgramSDK_configWindow, _ZaloMiniProgramSDK_configApp, _ZaloMiniProgramSDK_callJump, _ZaloMiniProgramSDK_setNavigationBarRightButton, _ZaloMiniProgramSDK_getActionsSupported;
38871
38675
  class ZaloMiniProgramSDK extends ZJSBridgeProvider {
38872
38676
  constructor() {
38873
38677
  super();
@@ -38876,17 +38680,16 @@
38876
38680
  _ZaloMiniProgramSDK_appConfig.set(this, window.APP_CONFIG || {});
38877
38681
  _ZaloMiniProgramSDK_zOAuth.set(this, void 0);
38878
38682
  _ZaloMiniProgramSDK_zOAuthVrf.set(this, void 0);
38879
- _ZaloMiniProgramSDK_firstLogin.set(this, void 0);
38880
38683
  _ZaloMiniProgramSDK_accessToken.set(this, void 0);
38881
- _ZaloMiniProgramSDK_refreshToken.set(this, void 0);
38684
+ _ZaloMiniProgramSDK_refreshToken.set(this, null);
38882
38685
  _ZaloMiniProgramSDK_cache.set(this, {
38883
38686
  timer: {
38884
38687
  getToken: 0
38885
38688
  }
38886
38689
  });
38887
- _ZaloMiniProgramSDK_loggedIn.set(this, false);
38888
38690
  _ZaloMiniProgramSDK_prevGetTokenTimestamp.set(this, void 0);
38889
38691
  _ZaloMiniProgramSDK_tokenExpiresIn.set(this, void 0);
38692
+ _ZaloMiniProgramSDK_cookies.set(this, null);
38890
38693
  this.events = ZMPEEmitter.getInstance();
38891
38694
  _ZaloMiniProgramSDK_configWindow.set(this, () => {
38892
38695
  const appConfig = __classPrivateFieldGet(this, _ZaloMiniProgramSDK_appConfig).app || null;
@@ -38931,21 +38734,26 @@
38931
38734
  });
38932
38735
  _ZaloMiniProgramSDK_callJump.set(this, () => {
38933
38736
  return new Promise((resolve, reject) => {
38934
- this.callNative('action.jump.login', {})
38935
- .then((data) => {
38936
- const cookies = (data && data.cookiesOAuthLogins) || [];
38937
- const jsToken = cookies.find((cookie) => cookie.name === CONT.COOKIE_NAME.JS_TOKEN);
38938
- if (jsToken) {
38939
- this.setJSToken(jsToken.value);
38940
- window.ZJSBridge.setJSToken &&
38941
- window.ZJSBridge.setJSToken(jsToken.value);
38942
- }
38943
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_firstLogin, true);
38944
- resolve(cookies);
38945
- })
38946
- .catch((error) => {
38947
- reject(error);
38948
- });
38737
+ if (!lodash.isUndefined(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_cookies)) && !lodash.isNull(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_cookies))) {
38738
+ resolve(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_cookies));
38739
+ }
38740
+ else {
38741
+ this.callNative('action.jump.login', {})
38742
+ .then((data) => {
38743
+ const cookies = (data && data.cookiesOAuthLogins) || [];
38744
+ const jsToken = cookies.find((cookie) => cookie.name === CONFIG.COOKIE_NAME.JS_TOKEN);
38745
+ if (jsToken) {
38746
+ this.setJSToken(jsToken.value);
38747
+ window.ZJSBridge.setJSToken &&
38748
+ window.ZJSBridge.setJSToken(jsToken.value);
38749
+ }
38750
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDK_cookies, cookies);
38751
+ resolve(cookies);
38752
+ })
38753
+ .catch((error) => {
38754
+ reject(error);
38755
+ });
38756
+ }
38949
38757
  });
38950
38758
  });
38951
38759
  _ZaloMiniProgramSDK_setNavigationBarRightButton.set(this, NavigationBar.setNavigationBarRightButton);
@@ -39010,10 +38818,8 @@
39010
38818
  __classPrivateFieldSet(this, _ZaloMiniProgramSDK_zOAuth, null);
39011
38819
  __classPrivateFieldSet(this, _ZaloMiniProgramSDK_zOAuthVrf, null);
39012
38820
  __classPrivateFieldSet(this, _ZaloMiniProgramSDK_accessToken, null);
39013
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_refreshToken, '');
39014
38821
  this.isShowNavBar = true;
39015
38822
  this.isShowHomeButton = true;
39016
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_firstLogin, false);
39017
38823
  __classPrivateFieldSet(this, _ZaloMiniProgramSDK_prevGetTokenTimestamp, 0);
39018
38824
  __classPrivateFieldSet(this, _ZaloMiniProgramSDK_tokenExpiresIn, 0);
39019
38825
  // this.#configApp();
@@ -39025,7 +38831,7 @@
39025
38831
  return ZaloMiniProgramSDK.instance;
39026
38832
  }
39027
38833
  getLoginStatus() {
39028
- return __classPrivateFieldGet(this, _ZaloMiniProgramSDK_loggedIn);
38834
+ return lodash.isString(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken)) && __classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken).length > 0;
39029
38835
  }
39030
38836
  getAppId() {
39031
38837
  return __classPrivateFieldGet(this, _ZaloMiniProgramSDK_appId);
@@ -39036,14 +38842,12 @@
39036
38842
  login(object) {
39037
38843
  return __awaiter(this, void 0, void 0, function* () {
39038
38844
  const cookies = yield __classPrivateFieldGet(this, _ZaloMiniProgramSDK_callJump).call(this);
39039
- const zOAuthCookie = cookies.find((cookie) => cookie.name === CONT.COOKIE_NAME.ZOAUTH);
39040
- const zOAuthVrfCookie = cookies.find((cookie) => cookie.name === CONT.COOKIE_NAME.ZOAUTH_VRF);
38845
+ const zOAuthCookie = cookies.find((cookie) => cookie.name === CONFIG.COOKIE_NAME.ZOAUTH);
38846
+ const zOAuthVrfCookie = cookies.find((cookie) => cookie.name === CONFIG.COOKIE_NAME.ZOAUTH_VRF);
39041
38847
  if (!lodash.isUndefined(zOAuthCookie) &&
39042
38848
  !lodash.isNull(zOAuthCookie) &&
39043
38849
  lodash.isString(zOAuthCookie.value)) {
39044
38850
  __classPrivateFieldSet(this, _ZaloMiniProgramSDK_zOAuth, zOAuthCookie.value);
39045
- clearInterval(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_cache).timer.getToken);
39046
- __classPrivateFieldGet(this, _ZaloMiniProgramSDK_cache).timer.getToken = 0;
39047
38851
  if (!lodash.isUndefined(zOAuthVrfCookie) &&
39048
38852
  !lodash.isNull(zOAuthVrfCookie) &&
39049
38853
  lodash.isString(zOAuthVrfCookie.value)) {
@@ -39062,17 +38866,12 @@
39062
38866
  });
39063
38867
  }
39064
38868
  loginZaloV3() {
39065
- const runner = () => __awaiter(this, void 0, void 0, function* () {
39066
- if (lodash.isUndefined(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuth)) || lodash.isNull(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuth))) {
39067
- clearInterval(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_cache).timer.getToken);
39068
- __classPrivateFieldGet(this, _ZaloMiniProgramSDK_cache).timer.getToken = 0;
39069
- return;
39070
- }
38869
+ return __awaiter(this, void 0, void 0, function* () {
39071
38870
  return yield axios
39072
- .get('https://oauth.zaloapp.com/v3/access_token', {
38871
+ .get(CONFIG.APIS.GET_ACCESS_TOKEN_V3, {
39073
38872
  params: {
39074
38873
  app_id: __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zAppId),
39075
- redirect_uri: `https://h5.zdn.vn/zapps/${__classPrivateFieldGet(this, _ZaloMiniProgramSDK_appId)}/`,
38874
+ redirect_uri: `${CONFIG.MINI_APP_INTERNAL_LINK}/${__classPrivateFieldGet(this, _ZaloMiniProgramSDK_appId)}/`,
39076
38875
  code: __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuth),
39077
38876
  isSDK: true
39078
38877
  }
@@ -39084,33 +38883,22 @@
39084
38883
  const expiresIn = parseInt(resData.expires_in) * 1000;
39085
38884
  __classPrivateFieldSet(this, _ZaloMiniProgramSDK_tokenExpiresIn, expiresIn);
39086
38885
  __classPrivateFieldSet(this, _ZaloMiniProgramSDK_prevGetTokenTimestamp, new Date().getTime());
39087
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_loggedIn, true);
39088
38886
  this.setZAccSession(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken) || '');
39089
38887
  window.ZJSBridge.setZAccSession &&
39090
38888
  window.ZJSBridge.setZAccSession(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken) || '');
39091
38889
  return __classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken);
39092
38890
  }
39093
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_loggedIn, false);
39094
38891
  return null;
39095
38892
  });
39096
38893
  });
39097
- return runner();
39098
38894
  }
39099
38895
  loginZaloV4() {
39100
38896
  return __awaiter(this, void 0, void 0, function* () {
39101
- if (lodash.isUndefined(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuth)) ||
39102
- lodash.isNull(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuth)) ||
39103
- lodash.isUndefined(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuthVrf)) ||
39104
- lodash.isNull(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuthVrf))) {
39105
- clearInterval(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_cache).timer.getToken);
39106
- __classPrivateFieldGet(this, _ZaloMiniProgramSDK_cache).timer.getToken = 0;
39107
- return;
39108
- }
39109
38897
  const inputData = new URLSearchParams();
39110
38898
  inputData.append('app_id', __classPrivateFieldGet(this, _ZaloMiniProgramSDK_appId));
39111
- inputData.append('code', __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuth));
39112
- inputData.append('code_verifier', __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuthVrf));
39113
- if (__classPrivateFieldGet(this, _ZaloMiniProgramSDK_firstLogin)) {
38899
+ inputData.append('code', __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuth) || '');
38900
+ inputData.append('code_verifier', __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuthVrf) || '');
38901
+ if (lodash.isNull(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_refreshToken))) {
39114
38902
  inputData.append('grant_type', 'authorization_code');
39115
38903
  }
39116
38904
  else {
@@ -39123,10 +38911,9 @@
39123
38911
  }
39124
38912
  };
39125
38913
  return yield axios
39126
- .post('https://h5.zalo.me/openapi/access_token', inputData, config)
38914
+ .post(CONFIG.APIS.GET_ACCESS_TOKEN, inputData, config)
39127
38915
  .then((response) => {
39128
38916
  const resData = response.data;
39129
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_firstLogin, false);
39130
38917
  if (resData.refresh_token) {
39131
38918
  __classPrivateFieldSet(this, _ZaloMiniProgramSDK_refreshToken, resData.refresh_token);
39132
38919
  }
@@ -39135,13 +38922,11 @@
39135
38922
  const expiresIn = parseInt(resData.expires_in) * 1000;
39136
38923
  __classPrivateFieldSet(this, _ZaloMiniProgramSDK_tokenExpiresIn, expiresIn);
39137
38924
  __classPrivateFieldSet(this, _ZaloMiniProgramSDK_prevGetTokenTimestamp, new Date().getTime());
39138
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_loggedIn, true);
39139
38925
  this.setZAccSession(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken) || '');
39140
38926
  window.ZJSBridge.setZAccSession &&
39141
38927
  window.ZJSBridge.setZAccSession(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken) || '');
39142
38928
  return __classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken);
39143
38929
  }
39144
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_loggedIn, false);
39145
38930
  return null;
39146
38931
  });
39147
38932
  });
@@ -39158,7 +38943,7 @@
39158
38943
  });
39159
38944
  }
39160
38945
  }
39161
- _ZaloMiniProgramSDK_zAppId = new WeakMap(), _ZaloMiniProgramSDK_appId = new WeakMap(), _ZaloMiniProgramSDK_appConfig = new WeakMap(), _ZaloMiniProgramSDK_zOAuth = new WeakMap(), _ZaloMiniProgramSDK_zOAuthVrf = new WeakMap(), _ZaloMiniProgramSDK_firstLogin = new WeakMap(), _ZaloMiniProgramSDK_accessToken = new WeakMap(), _ZaloMiniProgramSDK_refreshToken = new WeakMap(), _ZaloMiniProgramSDK_cache = new WeakMap(), _ZaloMiniProgramSDK_loggedIn = new WeakMap(), _ZaloMiniProgramSDK_prevGetTokenTimestamp = new WeakMap(), _ZaloMiniProgramSDK_tokenExpiresIn = new WeakMap(), _ZaloMiniProgramSDK_configWindow = new WeakMap(), _ZaloMiniProgramSDK_configApp = new WeakMap(), _ZaloMiniProgramSDK_callJump = new WeakMap(), _ZaloMiniProgramSDK_setNavigationBarRightButton = new WeakMap(), _ZaloMiniProgramSDK_getActionsSupported = new WeakMap();
38946
+ _ZaloMiniProgramSDK_zAppId = new WeakMap(), _ZaloMiniProgramSDK_appId = new WeakMap(), _ZaloMiniProgramSDK_appConfig = new WeakMap(), _ZaloMiniProgramSDK_zOAuth = new WeakMap(), _ZaloMiniProgramSDK_zOAuthVrf = new WeakMap(), _ZaloMiniProgramSDK_accessToken = new WeakMap(), _ZaloMiniProgramSDK_refreshToken = new WeakMap(), _ZaloMiniProgramSDK_cache = new WeakMap(), _ZaloMiniProgramSDK_prevGetTokenTimestamp = new WeakMap(), _ZaloMiniProgramSDK_tokenExpiresIn = new WeakMap(), _ZaloMiniProgramSDK_cookies = new WeakMap(), _ZaloMiniProgramSDK_configWindow = new WeakMap(), _ZaloMiniProgramSDK_configApp = new WeakMap(), _ZaloMiniProgramSDK_callJump = new WeakMap(), _ZaloMiniProgramSDK_setNavigationBarRightButton = new WeakMap(), _ZaloMiniProgramSDK_getActionsSupported = new WeakMap();
39162
38947
 
39163
38948
  var _MockSDK_appId, _MockSDK_appConfig, _MockSDK_zOAuth, _MockSDK_accessToken, _MockSDK_cache, _MockSDK_loggedId;
39164
38949
  class MockSDK {
@@ -41384,7 +41169,8 @@
41384
41169
  chatOnly: 'boolean',
41385
41170
  id: 'string',
41386
41171
  title: 'string',
41387
- thumbnail: 'url'
41172
+ thumbnail: 'url',
41173
+ path: 'string'
41388
41174
  }, 'data')),
41389
41175
  __param(0, required('type', 'data'))
41390
41176
  ], SDKCreator.prototype, "openShareSheet", null);