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