@dcloudio/uni-app-plus 3.0.0-alpha-4020520240808001 → 3.0.0-alpha-4020620240820001

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.
@@ -1,4 +1,4 @@
1
- import { normalizeStyles as normalizeStyles$1, addLeadingSlash, invokeArrayFns, parseQuery, Emitter, ON_UNHANDLE_REJECTION, ON_PAGE_NOT_FOUND, ON_ERROR, ON_SHOW, ON_HIDE, removeLeadingSlash, getLen, EventChannel, once, parseUrl, ON_UNLOAD, ON_READY, ON_PAGE_SCROLL, ON_PULL_DOWN_REFRESH, ON_REACH_BOTTOM, ON_RESIZE, ON_BACK_PRESS, ON_LAUNCH } from "@dcloudio/uni-shared";
1
+ import { normalizeStyles as normalizeStyles$1, addLeadingSlash, invokeArrayFns, parseQuery, Emitter, ON_UNHANDLE_REJECTION, ON_PAGE_NOT_FOUND, ON_ERROR, ON_SHOW, ON_HIDE, removeLeadingSlash, getLen, EventChannel, once, parseUrl, ON_UNLOAD, ON_READY, ON_PAGE_SCROLL, ON_PULL_DOWN_REFRESH, ON_REACH_BOTTOM, ON_RESIZE, ON_LAUNCH, ON_BACK_PRESS } from "@dcloudio/uni-shared";
2
2
  import { extend, isString, isPlainObject, isFunction as isFunction$1, isArray, isPromise, hasOwn, remove, invokeArrayFns as invokeArrayFns$1, capitalize, toTypeString, toRawType, parseStringStyle } from "@vue/shared";
3
3
  import { createVNode, render, injectHook, getCurrentInstance, defineComponent, warn, isInSSRComponentSetup, ref, watchEffect, watch, computed, onMounted, camelize, onUnmounted, reactive, nextTick } from "vue";
4
4
  function getCurrentPage() {
@@ -1520,88 +1520,161 @@ function setStatusBarStyle() {
1520
1520
  nativePage2.applyStatusBarStyle();
1521
1521
  }
1522
1522
  }
1523
- var $navigateTo = (args, _ref) => {
1523
+ function initGlobalEvent(app) {
1524
+ app.addKeyEventListener(ON_BACK_BUTTON, () => {
1525
+ backbuttonListener();
1526
+ return true;
1527
+ });
1528
+ }
1529
+ function loadFontFaceByStyles(styles2, global) {
1530
+ styles2 = Array.isArray(styles2) ? styles2 : [styles2];
1531
+ var fontFaceStyle = [];
1532
+ styles2.forEach((style) => {
1533
+ if (style["@FONT-FACE"]) {
1534
+ fontFaceStyle.push(...style["@FONT-FACE"]);
1535
+ }
1536
+ });
1537
+ if (fontFaceStyle.length === 0)
1538
+ return;
1539
+ fontFaceStyle.forEach((style) => {
1540
+ var fontFamily = style["fontFamily"];
1541
+ var fontWeight = style["fontWeight"];
1542
+ var fontStyle = style["fontStyle"];
1543
+ var fontVariant = style["fontVariant"];
1544
+ var src = style["src"];
1545
+ if (fontFamily != null && src != null) {
1546
+ loadFontFace({
1547
+ global,
1548
+ family: fontFamily,
1549
+ source: src,
1550
+ desc: {
1551
+ style: fontStyle,
1552
+ weight: fontWeight,
1553
+ variant: fontVariant
1554
+ }
1555
+ });
1556
+ } else {
1557
+ console.warn("loadFontFace: fail, font-family or src is null");
1558
+ }
1559
+ });
1560
+ }
1561
+ var API_GET_LAUNCH_OPTIONS_SYNC = "getLaunchOptionsSync";
1562
+ var launchOptions = {
1563
+ path: "",
1564
+ appScheme: null,
1565
+ appLink: null
1566
+ };
1567
+ var setLaunchOptionsSync = function(options) {
1568
+ launchOptions = options;
1569
+ };
1570
+ var getLaunchOptionsSync = /* @__PURE__ */ defineSyncApi(API_GET_LAUNCH_OPTIONS_SYNC, () => {
1571
+ var baseInfo = getLaunchOptions();
1572
+ return Object.assign({}, baseInfo, launchOptions);
1573
+ });
1574
+ var API_GET_ENTER_OPTIONS_SYNC = "getEnterOptionsSync";
1575
+ var enterOptions = {
1576
+ path: "",
1577
+ appScheme: null,
1578
+ appLink: null
1579
+ };
1580
+ var setEnterOptionsSync = function(options) {
1581
+ enterOptions = options;
1582
+ };
1583
+ var getEnterOptionsSync = /* @__PURE__ */ defineSyncApi(API_GET_ENTER_OPTIONS_SYNC, () => {
1584
+ var baseInfo = getLaunchOptions();
1585
+ return Object.assign({}, baseInfo, enterOptions);
1586
+ });
1587
+ function initAppLaunch(appVm) {
1588
+ injectAppHooks(appVm.$);
1524
1589
  var {
1525
- resolve,
1526
- reject
1590
+ entryPagePath,
1591
+ entryPageQuery,
1592
+ referrerInfo
1593
+ } = __uniConfig;
1594
+ var args = initLaunchOptions({
1595
+ path: entryPagePath,
1596
+ query: entryPageQuery,
1597
+ referrerInfo
1598
+ });
1599
+ var app = getNativeApp();
1600
+ var schemaLink = app.getLaunchOptionsSync();
1601
+ var launchOption = extend({}, args, schemaLink);
1602
+ setLaunchOptionsSync(launchOption);
1603
+ invokeHook(appVm, ON_LAUNCH, launchOption);
1604
+ var showOption = extend({}, launchOption);
1605
+ setEnterOptionsSync(showOption);
1606
+ invokeHook(appVm, ON_SHOW, showOption);
1607
+ var appStyle = appVm.$options.styles;
1608
+ if (appStyle) {
1609
+ loadFontFaceByStyles(appStyle, true);
1610
+ }
1611
+ useTheme();
1612
+ }
1613
+ var redirectTo = /* @__PURE__ */ defineAsyncApi(API_REDIRECT_TO, (_ref, _ref2) => {
1614
+ var {
1615
+ url
1527
1616
  } = _ref;
1528
1617
  var {
1529
- url,
1530
- events,
1531
- animationType,
1532
- animationDuration
1533
- } = args;
1618
+ resolve,
1619
+ reject
1620
+ } = _ref2;
1534
1621
  var {
1535
1622
  path,
1536
1623
  query
1537
1624
  } = parseUrl(url);
1538
- var [aniType, aniDuration] = initAnimation(path, animationType, animationDuration);
1539
- _navigateTo({
1625
+ if (!entryPageState.isReady) {
1626
+ redirectToPagesBeforeEntryPages.push({
1627
+ args: {
1628
+ url,
1629
+ path,
1630
+ query
1631
+ },
1632
+ handler: {
1633
+ resolve,
1634
+ reject
1635
+ }
1636
+ });
1637
+ return;
1638
+ }
1639
+ _redirectTo({
1540
1640
  url,
1541
1641
  path,
1542
- query,
1543
- events,
1544
- aniType,
1545
- aniDuration
1642
+ query
1546
1643
  }).then(resolve).catch(reject);
1547
- };
1548
- var navigateTo = /* @__PURE__ */ defineAsyncApi(API_NAVIGATE_TO, $navigateTo, NavigateToProtocol, NavigateToOptions);
1549
- function _navigateTo(_ref2) {
1644
+ }, RedirectToProtocol, RedirectToOptions);
1645
+ function _redirectTo(_ref3) {
1550
1646
  var {
1551
1647
  url,
1552
1648
  path,
1553
- query,
1554
- events,
1555
- aniType,
1556
- aniDuration
1557
- } = _ref2;
1558
- var currentPage = getCurrentPage();
1559
- var currentRouteType = currentPage == null ? "appLaunch" : API_NAVIGATE_TO;
1560
- invokeBeforeRouteHooks(currentRouteType);
1561
- invokeHook(ON_HIDE);
1562
- var eventChannel = new EventChannel(getWebviewId() + 1, events);
1649
+ query
1650
+ } = _ref3;
1651
+ var lastPage = getCurrentPage();
1563
1652
  return new Promise((resolve) => {
1564
- var noAnimation = aniType === "none" || aniDuration === 0;
1565
- function callback(page2) {
1566
- showWebview(page2, aniType, aniDuration, () => {
1567
- invokeAfterRouteHooks(currentRouteType);
1568
- resolve({
1569
- eventChannel
1570
- });
1571
- setStatusBarStyle();
1572
- });
1573
- }
1574
- var page = registerPage(
1575
- {
1576
- url,
1577
- path,
1578
- query,
1579
- openType: "navigateTo",
1580
- eventChannel
1581
- },
1582
- noAnimation ? void 0 : callback,
1583
- // 有动画时延迟创建 vm
1584
- noAnimation ? 0 : 1
1585
- );
1586
- if (noAnimation) {
1587
- callback(page);
1588
- }
1653
+ invokeAfterRouteHooks(API_REDIRECT_TO);
1654
+ showWebview(registerPage({
1655
+ url,
1656
+ path,
1657
+ query,
1658
+ openType: isTabPage(lastPage) || getAllPages().length === 1 ? "reLaunch" : "redirectTo"
1659
+ }), "none", 0, () => {
1660
+ if (lastPage) {
1661
+ removePages(lastPage);
1662
+ }
1663
+ resolve(void 0);
1664
+ setStatusBarStyle();
1665
+ });
1666
+ invokeBeforeRouteHooks(API_REDIRECT_TO);
1589
1667
  });
1590
1668
  }
1591
- function initAnimation(path, animationType, animationDuration) {
1592
- if (!getCurrentPage()) {
1593
- return ["none", 0];
1669
+ function removePages(currentPage) {
1670
+ if (isTabPage(currentPage)) {
1671
+ var pages2 = getAllPages().slice(0, -1);
1672
+ pages2.forEach((page) => {
1673
+ closePage(page, "none");
1674
+ });
1675
+ } else {
1676
+ closePage(currentPage, "none");
1594
1677
  }
1595
- var {
1596
- globalStyle
1597
- } = __uniConfig;
1598
- var meta = getRouteMeta(path);
1599
- return [animationType || meta.animationType || globalStyle.animationType || ANI_SHOW, animationDuration || meta.animationDuration || globalStyle.animationDuration || ANI_DURATION];
1600
- }
1601
- function closePage(page, animationType, animationDuration) {
1602
- closeWebview(page.$nativePage, animationType, animationDuration);
1603
- removePage(page);
1604
- removeTabBarPage(page);
1605
1678
  }
1606
1679
  var $reLaunch = (_ref, _ref2) => {
1607
1680
  var {
@@ -1615,6 +1688,18 @@ var $reLaunch = (_ref, _ref2) => {
1615
1688
  path,
1616
1689
  query
1617
1690
  } = parseUrl(url);
1691
+ if (!entryPageState.isReady) {
1692
+ reLaunchPagesBeforeEntryPages.push({
1693
+ args: {
1694
+ url
1695
+ },
1696
+ handler: {
1697
+ resolve,
1698
+ reject
1699
+ }
1700
+ });
1701
+ return;
1702
+ }
1618
1703
  _reLaunch({
1619
1704
  url,
1620
1705
  path,
@@ -1648,154 +1733,87 @@ function _reLaunch(_ref3) {
1648
1733
  });
1649
1734
  }
1650
1735
  var reLaunch = /* @__PURE__ */ defineAsyncApi(API_RE_LAUNCH, $reLaunch, ReLaunchProtocol, ReLaunchOptions);
1651
- function isDirectPage(page) {
1652
- return !!__uniConfig.realEntryPagePath && getRealPath(page.$page.route, true) === getRealPath(parseUrl(__uniConfig.entryPagePath).path, true);
1736
+ function closePage(page, animationType, animationDuration) {
1737
+ closeWebview(page.$nativePage, animationType, animationDuration);
1738
+ removePage(page);
1739
+ removeTabBarPage(page);
1653
1740
  }
1654
- function reLaunchEntryPage() {
1655
- var _uniConfig$entryPage;
1656
- __uniConfig.entryPagePath = __uniConfig.realEntryPagePath;
1657
- __uniConfig.realEntryPagePath = "";
1658
- reLaunch({
1659
- url: (_uniConfig$entryPage = __uniConfig.entryPagePath) !== null && _uniConfig$entryPage !== void 0 && _uniConfig$entryPage.startsWith("/") ? __uniConfig.entryPagePath : "/" + __uniConfig.entryPagePath
1741
+ function updateEntryPageIsReady(path) {
1742
+ if (!getCurrentPage() && path === addLeadingSlash(__uniConfig.entryPagePath)) {
1743
+ entryPageState.isReady = true;
1744
+ }
1745
+ }
1746
+ function handleBeforeEntryPageRoutes() {
1747
+ if (entryPageState.handledBeforeEntryPageRoutes) {
1748
+ return;
1749
+ }
1750
+ entryPageState.handledBeforeEntryPageRoutes = true;
1751
+ var navigateToPages = [...navigateToPagesBeforeEntryPages];
1752
+ navigateToPagesBeforeEntryPages.length = 0;
1753
+ navigateToPages.forEach((_ref) => {
1754
+ var {
1755
+ args,
1756
+ handler
1757
+ } = _ref;
1758
+ return $navigateTo(args, handler);
1759
+ });
1760
+ var switchTabPages = [...switchTabPagesBeforeEntryPages];
1761
+ switchTabPagesBeforeEntryPages.length = 0;
1762
+ switchTabPages.forEach((_ref2) => {
1763
+ var {
1764
+ args,
1765
+ handler
1766
+ } = _ref2;
1767
+ return $switchTab(args, handler);
1768
+ });
1769
+ var redirectToPages = [...redirectToPagesBeforeEntryPages];
1770
+ redirectToPagesBeforeEntryPages.length = 0;
1771
+ redirectToPages.forEach((_ref3) => {
1772
+ var {
1773
+ args,
1774
+ handler
1775
+ } = _ref3;
1776
+ return _redirectTo(args).then(handler.resolve).catch(handler.reject);
1777
+ });
1778
+ var reLaunchPages = [...reLaunchPagesBeforeEntryPages];
1779
+ reLaunchPagesBeforeEntryPages.length = 0;
1780
+ reLaunchPages.forEach((_ref4) => {
1781
+ var {
1782
+ args,
1783
+ handler
1784
+ } = _ref4;
1785
+ return $reLaunch(args, handler);
1660
1786
  });
1661
1787
  }
1662
- var navigateBack = /* @__PURE__ */ defineAsyncApi(API_NAVIGATE_BACK, (args, _ref) => {
1788
+ var $switchTab = (args, _ref) => {
1663
1789
  var {
1664
1790
  resolve,
1665
1791
  reject
1666
1792
  } = _ref;
1667
- var page = getCurrentPage();
1668
- if (!page) {
1669
- return reject("getCurrentPages is empty");
1670
- }
1671
- if (
1672
- // popGesture 时不触发 onBackPress 事件,避免引发半屏弹窗这种冲突情况
1673
- args.from !== "popGesture" && invokeHook(page, ON_BACK_PRESS, {
1674
- from: args.from || "navigateBack"
1675
- })
1676
- ) {
1677
- return reject("cancel");
1678
- }
1679
- try {
1680
- uni.hideToast();
1681
- uni.hideLoading();
1682
- } catch (error) {
1683
- console.warn(error);
1793
+ var {
1794
+ url
1795
+ } = args;
1796
+ var {
1797
+ path,
1798
+ query
1799
+ } = parseUrl(url);
1800
+ updateEntryPageIsReady(path);
1801
+ if (!entryPageState.isReady) {
1802
+ switchTabPagesBeforeEntryPages.push({
1803
+ args,
1804
+ handler: {
1805
+ resolve,
1806
+ reject
1807
+ }
1808
+ });
1809
+ return;
1684
1810
  }
1685
- if (page.$page.meta.isQuit)
1686
- ;
1687
- else {
1688
- if (isDirectPage(page)) {
1689
- return reLaunchEntryPage();
1690
- } else {
1691
- var {
1692
- delta,
1693
- animationType,
1694
- animationDuration
1695
- } = args;
1696
- back(delta, animationType, animationDuration);
1697
- }
1698
- }
1699
- return resolve();
1700
- }, NavigateBackProtocol, NavigateBackOptions);
1701
- function back(delta, animationType, animationDuration) {
1702
- var pages2 = getCurrentPages();
1703
- var len = pages2.length;
1704
- var currentPage = pages2[len - 1];
1705
- if (delta > 1) {
1706
- pages2.slice(len - delta, len - 1).reverse().forEach((deltaPage) => {
1707
- closeWebview(getNativeApp().pageManager.findPageById(deltaPage.$page.id + ""), "none", 0);
1708
- });
1709
- }
1710
- var backPage = function(webview2) {
1711
- if (animationType) {
1712
- animationDuration = animationDuration || ANI_DURATION;
1713
- } else {
1714
- if (currentPage.$page.openType === "redirectTo") {
1715
- animationType = ANI_CLOSE;
1716
- animationDuration = ANI_DURATION;
1717
- } else {
1718
- animationType = "auto";
1719
- }
1720
- }
1721
- closeWebview(webview2, animationType, animationDuration, () => {
1722
- pages2.slice(len - delta, len).forEach((page) => removePage(page));
1723
- invokeHook(ON_SHOW);
1724
- setStatusBarStyle();
1725
- });
1726
- };
1727
- var webview = getNativeApp().pageManager.findPageById(currentPage.$page.id + "");
1728
- backPage(webview);
1729
- }
1730
- var redirectTo = /* @__PURE__ */ defineAsyncApi(API_REDIRECT_TO, (_ref, _ref2) => {
1731
- var {
1732
- url
1733
- } = _ref;
1734
- var {
1735
- resolve,
1736
- reject
1737
- } = _ref2;
1738
- var {
1739
- path,
1740
- query
1741
- } = parseUrl(url);
1742
- _redirectTo({
1743
- url,
1744
- path,
1745
- query
1746
- }).then(resolve).catch(reject);
1747
- }, RedirectToProtocol, RedirectToOptions);
1748
- function _redirectTo(_ref3) {
1749
- var {
1750
- url,
1751
- path,
1752
- query
1753
- } = _ref3;
1754
- var lastPage = getCurrentPage();
1755
- return new Promise((resolve) => {
1756
- invokeAfterRouteHooks(API_REDIRECT_TO);
1757
- showWebview(registerPage({
1758
- url,
1759
- path,
1760
- query,
1761
- openType: isTabPage(lastPage) || getAllPages().length === 1 ? "reLaunch" : "redirectTo"
1762
- }), "none", 0, () => {
1763
- if (lastPage) {
1764
- removePages(lastPage);
1765
- }
1766
- resolve(void 0);
1767
- setStatusBarStyle();
1768
- });
1769
- invokeBeforeRouteHooks(API_REDIRECT_TO);
1770
- });
1771
- }
1772
- function removePages(currentPage) {
1773
- if (isTabPage(currentPage)) {
1774
- var pages2 = getAllPages().slice(0, -1);
1775
- pages2.forEach((page) => {
1776
- closePage(page, "none");
1777
- });
1778
- } else {
1779
- closePage(currentPage, "none");
1780
- }
1781
- }
1782
- var $switchTab = (args, _ref) => {
1783
- var {
1784
- resolve,
1785
- reject
1786
- } = _ref;
1787
- var {
1788
- url
1789
- } = args;
1790
- var {
1791
- path,
1792
- query
1793
- } = parseUrl(url);
1794
1811
  _switchTab({
1795
1812
  url,
1796
1813
  path,
1797
1814
  query
1798
1815
  }).then(resolve).catch(reject);
1816
+ handleBeforeEntryPageRoutes();
1799
1817
  };
1800
1818
  var switchTab = /* @__PURE__ */ defineAsyncApi(API_SWITCH_TAB, $switchTab, SwitchTabProtocol, SwitchTabOptions);
1801
1819
  function _switchTab(_ref2) {
@@ -1819,124 +1837,499 @@ function _switchTab(_ref2) {
1819
1837
  }
1820
1838
  return Promise.resolve();
1821
1839
  }
1822
- var setTabBarBadge = /* @__PURE__ */ defineAsyncApi(API_SET_TAB_BAR_BADGE, (_ref, _ref2) => {
1823
- var {
1824
- index: index2,
1825
- text
1826
- } = _ref;
1827
- var {
1828
- resolve,
1829
- reject
1830
- } = _ref2;
1831
- var tabBar = getTabBar();
1832
- if (tabBar === null) {
1833
- reject("tabBar is not exist");
1834
- return;
1835
- }
1836
- tabBar.setTabBarBadge(/* @__PURE__ */ new Map([["index", index2], ["text", text]]));
1837
- resolve();
1838
- }, SetTabBarBadgeProtocol, SetTabBarBadgeOptions);
1839
- var removeTabBarBadge = /* @__PURE__ */ defineAsyncApi(API_REMOVE_TAB_BAR_BADGE, (_ref, _ref2) => {
1840
- var {
1841
- index: index2
1842
- } = _ref;
1843
- var {
1844
- resolve,
1845
- reject
1846
- } = _ref2;
1847
- var tabBar = getTabBar();
1848
- if (tabBar === null) {
1849
- reject("tabBar is not exist");
1850
- return;
1851
- }
1852
- tabBar.removeTabBarBadge(/* @__PURE__ */ new Map([["index", index2]]));
1853
- resolve();
1854
- }, RemoveTabBarBadgeProtocol, RemoveTabBarBadgeOptions);
1855
- var setTabBarItem = /* @__PURE__ */ defineAsyncApi(API_SET_TAB_BAR_ITEM, (_ref, _ref2) => {
1856
- var {
1857
- index: index2,
1858
- text,
1859
- iconPath,
1860
- selectedIconPath,
1861
- pagePath,
1862
- visible,
1863
- iconfont
1864
- } = _ref;
1865
- var {
1866
- resolve,
1867
- reject
1868
- } = _ref2;
1869
- var tabBar = getTabBar();
1870
- if (tabBar === null) {
1871
- reject("tabBar is not exist");
1840
+ var isLaunchWebviewReady = false;
1841
+ function subscribeWebviewReady(_data, pageId) {
1842
+ var isLaunchWebview = pageId === "1";
1843
+ if (isLaunchWebview && isLaunchWebviewReady) {
1872
1844
  return;
1873
1845
  }
1874
- var item = /* @__PURE__ */ new Map([["index", index2], ["text", text], ["iconPath", iconPath], ["selectedIconPath", selectedIconPath], ["pagePath", pagePath], ["visible", visible]]);
1875
- if (!!iconfont) {
1876
- var iconfontOptions = iconfont;
1877
- var _iconfont = /* @__PURE__ */ new Map([["text", iconfontOptions.text], ["selectedText", iconfontOptions.selectedText], ["fontSize", iconfontOptions.fontSize], ["color", iconfontOptions.color], ["selectedColor", iconfontOptions.selectedColor]]);
1878
- item.set("iconfont", _iconfont);
1879
- }
1880
- tabBar.setTabBarItem(item);
1881
- resolve();
1882
- }, SetTabBarItemProtocol, SetTabBarItemOptions);
1883
- var setTabBarStyle = /* @__PURE__ */ defineAsyncApi(API_SET_TAB_BAR_STYLE, (options, _ref) => {
1884
- var {
1885
- resolve,
1886
- reject
1887
- } = _ref;
1888
- var tabBar = getTabBar();
1889
- if (tabBar === null) {
1890
- reject("tabBar is not exist");
1891
- return;
1846
+ if (isLaunchWebview) {
1847
+ isLaunchWebviewReady = true;
1892
1848
  }
1893
- var style = /* @__PURE__ */ new Map([["color", options.color], ["selectedColor", options.selectedColor], ["backgroundColor", options.backgroundColor], ["backgroundImage", options.backgroundImage], ["backgroundRepeat", options.backgroundRepeat], ["borderStyle", options.borderStyle], ["borderColor", options.borderColor]]);
1894
- if (!!options.midButton) {
1895
- var midButtonOptions = options.midButton;
1896
- var midButton = /* @__PURE__ */ new Map([["width", midButtonOptions.width], ["height", midButtonOptions.height], ["iconPath", midButtonOptions.iconPath], ["text", midButtonOptions.text], ["iconPath", midButtonOptions.iconPath], ["iconWidth", midButtonOptions.iconWidth], ["backgroundImage", midButtonOptions.backgroundImage]]);
1897
- if (!!midButtonOptions.iconfont) {
1898
- var iconfontOptions = midButtonOptions.iconfont;
1899
- var iconfont = /* @__PURE__ */ new Map([["text", iconfontOptions.text], ["selectedText", iconfontOptions.selectedText], ["fontSize", iconfontOptions.fontSize], ["color", iconfontOptions.color], ["selectedColor", iconfontOptions.selectedColor]]);
1900
- midButton.set("iconfont", iconfont);
1849
+ isLaunchWebview && onLaunchWebviewReady();
1850
+ }
1851
+ function onLaunchWebviewReady() {
1852
+ var entryPagePath = addLeadingSlash(__uniConfig.entryPagePath);
1853
+ var routeOptions = getRouteOptions(entryPagePath);
1854
+ var args = {
1855
+ url: entryPagePath + (__uniConfig.entryPageQuery || ""),
1856
+ openType: "appLaunch"
1857
+ };
1858
+ var handler = {
1859
+ resolve() {
1860
+ },
1861
+ reject() {
1901
1862
  }
1902
- style.set("midButton", midButton);
1863
+ };
1864
+ if (routeOptions.meta.isTabBar) {
1865
+ return $switchTab(args, handler);
1903
1866
  }
1904
- fixBorderStyle(style);
1905
- tabBar.setTabBarStyle(style);
1906
- resolve();
1907
- }, SetTabBarStyleProtocol, SetTabBarStyleOptions);
1908
- var hideTabBar = /* @__PURE__ */ defineAsyncApi(API_HIDE_TAB_BAR, (options, _ref) => {
1909
- var {
1910
- resolve,
1911
- reject
1912
- } = _ref;
1913
- var tabBar = getTabBar();
1914
- if (tabBar === null) {
1915
- reject("tabBar is not exist");
1867
+ return $navigateTo(args, handler);
1868
+ }
1869
+ function initSubscribeHandlers() {
1870
+ subscribeWebviewReady({}, "1");
1871
+ }
1872
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
1873
+ try {
1874
+ var info = gen[key](arg);
1875
+ var value = info.value;
1876
+ } catch (error) {
1877
+ reject(error);
1916
1878
  return;
1917
1879
  }
1918
- tabBar.hideTabBar(/* @__PURE__ */ new Map([["animation", options === null || options === void 0 ? void 0 : options.animation]]));
1919
- resolve();
1920
- });
1921
- var showTabBar = /* @__PURE__ */ defineAsyncApi(API_SHOW_TAB_BAR, (args, _ref) => {
1922
- var {
1923
- resolve,
1924
- reject
1925
- } = _ref;
1926
- var tabBar = getTabBar();
1927
- var animation2 = args && args.animation;
1928
- if (tabBar === null) {
1929
- reject("tabBar is not exist");
1930
- return;
1880
+ if (info.done) {
1881
+ resolve(value);
1882
+ } else {
1883
+ Promise.resolve(value).then(_next, _throw);
1931
1884
  }
1932
- tabBar.showTabBar(/* @__PURE__ */ new Map([["animation", animation2]]));
1933
- resolve();
1934
- });
1935
- var showTabBarRedDot = /* @__PURE__ */ defineAsyncApi(API_SHOW_TAB_BAR_RED_DOT, (_ref, _ref2) => {
1936
- var {
1937
- index: index2
1938
- } = _ref;
1939
- var {
1885
+ }
1886
+ function _asyncToGenerator(fn) {
1887
+ return function() {
1888
+ var self = this, args = arguments;
1889
+ return new Promise(function(resolve, reject) {
1890
+ var gen = fn.apply(self, args);
1891
+ function _next(value) {
1892
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
1893
+ }
1894
+ function _throw(err) {
1895
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
1896
+ }
1897
+ _next(void 0);
1898
+ });
1899
+ };
1900
+ }
1901
+ function initOn(app) {
1902
+ app.addEventListener(ON_SHOW, /* @__PURE__ */ function() {
1903
+ var _ref = _asyncToGenerator(function* (event) {
1904
+ var app2 = getNativeApp();
1905
+ var MAX_TIMEOUT = 200;
1906
+ function getNewIntent() {
1907
+ return new Promise((resolve, reject) => {
1908
+ var handleNewIntent = (newIntent) => {
1909
+ var _newIntent$appScheme, _newIntent$appLink;
1910
+ clearTimeout(timeout);
1911
+ app2.removeEventListener("onNewIntent", handleNewIntent);
1912
+ resolve({
1913
+ appScheme: (_newIntent$appScheme = newIntent.appScheme) !== null && _newIntent$appScheme !== void 0 ? _newIntent$appScheme : null,
1914
+ appLink: (_newIntent$appLink = newIntent.appLink) !== null && _newIntent$appLink !== void 0 ? _newIntent$appLink : null
1915
+ });
1916
+ };
1917
+ var timeout = setTimeout(() => {
1918
+ app2.removeEventListener("onNewIntent", handleNewIntent);
1919
+ var appLink = {
1920
+ appScheme: null,
1921
+ appLink: null
1922
+ };
1923
+ resolve(appLink);
1924
+ }, MAX_TIMEOUT);
1925
+ app2.addEventListener("onNewIntent", handleNewIntent);
1926
+ });
1927
+ }
1928
+ var schemaLink = yield getNewIntent();
1929
+ var showOptions = extend({
1930
+ path: __uniConfig.entryPagePath
1931
+ }, schemaLink);
1932
+ setEnterOptionsSync(showOptions);
1933
+ var page = getCurrentPage();
1934
+ invokeHook(getApp(), ON_SHOW, showOptions);
1935
+ if (page) {
1936
+ invokeHook(page, ON_SHOW);
1937
+ }
1938
+ });
1939
+ return function(_x) {
1940
+ return _ref.apply(this, arguments);
1941
+ };
1942
+ }());
1943
+ app.addEventListener(ON_HIDE, function() {
1944
+ var page = getCurrentPage();
1945
+ invokeHook(getApp(), ON_HIDE);
1946
+ if (page) {
1947
+ invokeHook(page, ON_HIDE);
1948
+ }
1949
+ });
1950
+ }
1951
+ function initService(app) {
1952
+ initOn(app);
1953
+ }
1954
+ function initComponentInstance(app) {
1955
+ app.mixin({
1956
+ beforeCreate() {
1957
+ var vm = this;
1958
+ var instance = vm.$;
1959
+ if (instance.type.mpType === "app") {
1960
+ return;
1961
+ }
1962
+ var pageId = instance.root.attrs.__pageId;
1963
+ vm.$nativePage = getNativeApp().pageManager.findPageById(pageId + "");
1964
+ },
1965
+ beforeMount() {
1966
+ var _vm$$options$styles;
1967
+ var vm = this;
1968
+ var instance = vm.$;
1969
+ if (instance.type.mpType === "app") {
1970
+ return;
1971
+ }
1972
+ loadFontFaceByStyles((_vm$$options$styles = vm.$options.styles) !== null && _vm$$options$styles !== void 0 ? _vm$$options$styles : [], false);
1973
+ }
1974
+ });
1975
+ }
1976
+ var appCtx;
1977
+ var defaultApp = {
1978
+ globalData: {}
1979
+ };
1980
+ var entryPageState = {
1981
+ isReady: false,
1982
+ handledBeforeEntryPageRoutes: false
1983
+ };
1984
+ var navigateToPagesBeforeEntryPages = [];
1985
+ var switchTabPagesBeforeEntryPages = [];
1986
+ var redirectToPagesBeforeEntryPages = [];
1987
+ var reLaunchPagesBeforeEntryPages = [];
1988
+ function initAppVm(appVm) {
1989
+ appVm.$vm = appVm;
1990
+ appVm.$mpType = "app";
1991
+ }
1992
+ function getApp$1() {
1993
+ var {
1994
+ allowDefault = false
1995
+ } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1996
+ if (appCtx) {
1997
+ return appCtx;
1998
+ }
1999
+ if (allowDefault) {
2000
+ return defaultApp;
2001
+ }
2002
+ console.error("[warn]: getApp() failed. Learn more: https://uniapp.dcloud.io/collocation/frame/window?id=getapp.");
2003
+ }
2004
+ function registerApp(appVm, nativeApp2) {
2005
+ initEntryPagePath(nativeApp2);
2006
+ setNativeApp(nativeApp2);
2007
+ initVueApp(appVm);
2008
+ appCtx = appVm;
2009
+ initAppVm(appCtx);
2010
+ extend(appCtx, defaultApp);
2011
+ defineGlobalData(appCtx, defaultApp.globalData);
2012
+ initService(nativeApp2);
2013
+ initGlobalEvent(nativeApp2);
2014
+ initAppLaunch(appVm);
2015
+ initSubscribeHandlers();
2016
+ __uniConfig.ready = true;
2017
+ }
2018
+ function initApp(app) {
2019
+ initComponentInstance(app);
2020
+ }
2021
+ function initEntryPagePath(app) {
2022
+ var redirectInfo = app.getRedirectInfo();
2023
+ var debugInfo = redirectInfo.get("debug");
2024
+ if (debugInfo) {
2025
+ var url = debugInfo.get("url");
2026
+ if (url && url != __uniConfig.entryPagePath) {
2027
+ __uniConfig.realEntryPagePath = __uniConfig.entryPagePath;
2028
+ var [path, query] = url.split("?");
2029
+ __uniConfig.entryPagePath = path;
2030
+ if (query) {
2031
+ __uniConfig.entryPageQuery = "?".concat(query);
2032
+ }
2033
+ return;
2034
+ }
2035
+ }
2036
+ if (__uniConfig.conditionUrl) {
2037
+ __uniConfig.realEntryPagePath = __uniConfig.entryPagePath;
2038
+ var conditionUrl = __uniConfig.conditionUrl;
2039
+ var [_path, _query] = conditionUrl.split("?");
2040
+ __uniConfig.entryPagePath = _path;
2041
+ if (_query) {
2042
+ __uniConfig.entryPageQuery = "?".concat(_query);
2043
+ }
2044
+ }
2045
+ }
2046
+ var $navigateTo = (args, _ref) => {
2047
+ var {
2048
+ resolve,
2049
+ reject
2050
+ } = _ref;
2051
+ var {
2052
+ url,
2053
+ events,
2054
+ animationType,
2055
+ animationDuration
2056
+ } = args;
2057
+ var {
2058
+ path,
2059
+ query
2060
+ } = parseUrl(url);
2061
+ var [aniType, aniDuration] = initAnimation(path, animationType, animationDuration);
2062
+ updateEntryPageIsReady(path);
2063
+ if (!entryPageState.isReady) {
2064
+ navigateToPagesBeforeEntryPages.push({
2065
+ args,
2066
+ handler: {
2067
+ resolve,
2068
+ reject
2069
+ }
2070
+ });
2071
+ return;
2072
+ }
2073
+ _navigateTo({
2074
+ url,
2075
+ path,
2076
+ query,
2077
+ events,
2078
+ aniType,
2079
+ aniDuration
2080
+ }).then(resolve).catch(reject);
2081
+ handleBeforeEntryPageRoutes();
2082
+ };
2083
+ var navigateTo = /* @__PURE__ */ defineAsyncApi(API_NAVIGATE_TO, $navigateTo, NavigateToProtocol, NavigateToOptions);
2084
+ function _navigateTo(_ref2) {
2085
+ var {
2086
+ url,
2087
+ path,
2088
+ query,
2089
+ events,
2090
+ aniType,
2091
+ aniDuration
2092
+ } = _ref2;
2093
+ var currentPage = getCurrentPage();
2094
+ var currentRouteType = currentPage == null ? "appLaunch" : API_NAVIGATE_TO;
2095
+ invokeBeforeRouteHooks(currentRouteType);
2096
+ invokeHook(ON_HIDE);
2097
+ var eventChannel = new EventChannel(getWebviewId() + 1, events);
2098
+ return new Promise((resolve) => {
2099
+ var noAnimation = aniType === "none" || aniDuration === 0;
2100
+ function callback(page2) {
2101
+ showWebview(page2, aniType, aniDuration, () => {
2102
+ invokeAfterRouteHooks(currentRouteType);
2103
+ resolve({
2104
+ eventChannel
2105
+ });
2106
+ setStatusBarStyle();
2107
+ });
2108
+ }
2109
+ var page = registerPage(
2110
+ {
2111
+ url,
2112
+ path,
2113
+ query,
2114
+ openType: "navigateTo",
2115
+ eventChannel
2116
+ },
2117
+ noAnimation ? void 0 : callback,
2118
+ // 有动画时延迟创建 vm
2119
+ noAnimation ? 0 : 1
2120
+ );
2121
+ if (noAnimation) {
2122
+ callback(page);
2123
+ }
2124
+ });
2125
+ }
2126
+ function initAnimation(path, animationType, animationDuration) {
2127
+ if (!getCurrentPage()) {
2128
+ return ["none", 0];
2129
+ }
2130
+ var {
2131
+ globalStyle
2132
+ } = __uniConfig;
2133
+ var meta = getRouteMeta(path);
2134
+ return [animationType || meta.animationType || globalStyle.animationType || ANI_SHOW, animationDuration || meta.animationDuration || globalStyle.animationDuration || ANI_DURATION];
2135
+ }
2136
+ function isDirectPage(page) {
2137
+ return !!__uniConfig.realEntryPagePath && getRealPath(page.$page.route, true) === getRealPath(parseUrl(__uniConfig.entryPagePath).path, true);
2138
+ }
2139
+ function reLaunchEntryPage() {
2140
+ var _uniConfig$entryPage;
2141
+ __uniConfig.entryPagePath = __uniConfig.realEntryPagePath;
2142
+ __uniConfig.realEntryPagePath = "";
2143
+ reLaunch({
2144
+ url: (_uniConfig$entryPage = __uniConfig.entryPagePath) !== null && _uniConfig$entryPage !== void 0 && _uniConfig$entryPage.startsWith("/") ? __uniConfig.entryPagePath : "/" + __uniConfig.entryPagePath
2145
+ });
2146
+ }
2147
+ var navigateBack = /* @__PURE__ */ defineAsyncApi(API_NAVIGATE_BACK, (args, _ref) => {
2148
+ var {
2149
+ resolve,
2150
+ reject
2151
+ } = _ref;
2152
+ var page = getCurrentPage();
2153
+ if (!page) {
2154
+ return reject("getCurrentPages is empty");
2155
+ }
2156
+ if (
2157
+ // popGesture 时不触发 onBackPress 事件,避免引发半屏弹窗这种冲突情况
2158
+ args.from !== "popGesture" && invokeHook(page, ON_BACK_PRESS, {
2159
+ from: args.from || "navigateBack"
2160
+ })
2161
+ ) {
2162
+ return reject("cancel");
2163
+ }
2164
+ try {
2165
+ uni.hideToast();
2166
+ uni.hideLoading();
2167
+ } catch (error) {
2168
+ console.warn(error);
2169
+ }
2170
+ if (page.$page.meta.isQuit)
2171
+ ;
2172
+ else {
2173
+ if (isDirectPage(page)) {
2174
+ return reLaunchEntryPage();
2175
+ } else {
2176
+ var {
2177
+ delta,
2178
+ animationType,
2179
+ animationDuration
2180
+ } = args;
2181
+ back(delta, animationType, animationDuration);
2182
+ }
2183
+ }
2184
+ return resolve();
2185
+ }, NavigateBackProtocol, NavigateBackOptions);
2186
+ function back(delta, animationType, animationDuration) {
2187
+ var pages2 = getCurrentPages();
2188
+ var len = pages2.length;
2189
+ var currentPage = pages2[len - 1];
2190
+ if (delta > 1) {
2191
+ pages2.slice(len - delta, len - 1).reverse().forEach((deltaPage) => {
2192
+ closeWebview(getNativeApp().pageManager.findPageById(deltaPage.$page.id + ""), "none", 0);
2193
+ });
2194
+ }
2195
+ var backPage = function(webview2) {
2196
+ if (animationType) {
2197
+ animationDuration = animationDuration || ANI_DURATION;
2198
+ } else {
2199
+ if (currentPage.$page.openType === "redirectTo") {
2200
+ animationType = ANI_CLOSE;
2201
+ animationDuration = ANI_DURATION;
2202
+ } else {
2203
+ animationType = "auto";
2204
+ }
2205
+ }
2206
+ closeWebview(webview2, animationType, animationDuration, () => {
2207
+ pages2.slice(len - delta, len).forEach((page) => removePage(page));
2208
+ invokeHook(ON_SHOW);
2209
+ setStatusBarStyle();
2210
+ });
2211
+ };
2212
+ var webview = getNativeApp().pageManager.findPageById(currentPage.$page.id + "");
2213
+ backPage(webview);
2214
+ }
2215
+ var setTabBarBadge = /* @__PURE__ */ defineAsyncApi(API_SET_TAB_BAR_BADGE, (_ref, _ref2) => {
2216
+ var {
2217
+ index: index2,
2218
+ text
2219
+ } = _ref;
2220
+ var {
2221
+ resolve,
2222
+ reject
2223
+ } = _ref2;
2224
+ var tabBar = getTabBar();
2225
+ if (tabBar === null) {
2226
+ reject("tabBar is not exist");
2227
+ return;
2228
+ }
2229
+ tabBar.setTabBarBadge(/* @__PURE__ */ new Map([["index", index2], ["text", text]]));
2230
+ resolve();
2231
+ }, SetTabBarBadgeProtocol, SetTabBarBadgeOptions);
2232
+ var removeTabBarBadge = /* @__PURE__ */ defineAsyncApi(API_REMOVE_TAB_BAR_BADGE, (_ref, _ref2) => {
2233
+ var {
2234
+ index: index2
2235
+ } = _ref;
2236
+ var {
2237
+ resolve,
2238
+ reject
2239
+ } = _ref2;
2240
+ var tabBar = getTabBar();
2241
+ if (tabBar === null) {
2242
+ reject("tabBar is not exist");
2243
+ return;
2244
+ }
2245
+ tabBar.removeTabBarBadge(/* @__PURE__ */ new Map([["index", index2]]));
2246
+ resolve();
2247
+ }, RemoveTabBarBadgeProtocol, RemoveTabBarBadgeOptions);
2248
+ var setTabBarItem = /* @__PURE__ */ defineAsyncApi(API_SET_TAB_BAR_ITEM, (_ref, _ref2) => {
2249
+ var {
2250
+ index: index2,
2251
+ text,
2252
+ iconPath,
2253
+ selectedIconPath,
2254
+ pagePath,
2255
+ visible,
2256
+ iconfont
2257
+ } = _ref;
2258
+ var {
2259
+ resolve,
2260
+ reject
2261
+ } = _ref2;
2262
+ var tabBar = getTabBar();
2263
+ if (tabBar === null) {
2264
+ reject("tabBar is not exist");
2265
+ return;
2266
+ }
2267
+ var item = /* @__PURE__ */ new Map([["index", index2], ["text", text], ["iconPath", iconPath], ["selectedIconPath", selectedIconPath], ["pagePath", pagePath], ["visible", visible]]);
2268
+ if (!!iconfont) {
2269
+ var iconfontOptions = iconfont;
2270
+ var _iconfont = /* @__PURE__ */ new Map([["text", iconfontOptions.text], ["selectedText", iconfontOptions.selectedText], ["fontSize", iconfontOptions.fontSize], ["color", iconfontOptions.color], ["selectedColor", iconfontOptions.selectedColor]]);
2271
+ item.set("iconfont", _iconfont);
2272
+ }
2273
+ tabBar.setTabBarItem(item);
2274
+ resolve();
2275
+ }, SetTabBarItemProtocol, SetTabBarItemOptions);
2276
+ var setTabBarStyle = /* @__PURE__ */ defineAsyncApi(API_SET_TAB_BAR_STYLE, (options, _ref) => {
2277
+ var {
2278
+ resolve,
2279
+ reject
2280
+ } = _ref;
2281
+ var tabBar = getTabBar();
2282
+ if (tabBar === null) {
2283
+ reject("tabBar is not exist");
2284
+ return;
2285
+ }
2286
+ var style = /* @__PURE__ */ new Map([["color", options.color], ["selectedColor", options.selectedColor], ["backgroundColor", options.backgroundColor], ["backgroundImage", options.backgroundImage], ["backgroundRepeat", options.backgroundRepeat], ["borderStyle", options.borderStyle], ["borderColor", options.borderColor]]);
2287
+ if (!!options.midButton) {
2288
+ var midButtonOptions = options.midButton;
2289
+ var midButton = /* @__PURE__ */ new Map([["width", midButtonOptions.width], ["height", midButtonOptions.height], ["iconPath", midButtonOptions.iconPath], ["text", midButtonOptions.text], ["iconPath", midButtonOptions.iconPath], ["iconWidth", midButtonOptions.iconWidth], ["backgroundImage", midButtonOptions.backgroundImage]]);
2290
+ if (!!midButtonOptions.iconfont) {
2291
+ var iconfontOptions = midButtonOptions.iconfont;
2292
+ var iconfont = /* @__PURE__ */ new Map([["text", iconfontOptions.text], ["selectedText", iconfontOptions.selectedText], ["fontSize", iconfontOptions.fontSize], ["color", iconfontOptions.color], ["selectedColor", iconfontOptions.selectedColor]]);
2293
+ midButton.set("iconfont", iconfont);
2294
+ }
2295
+ style.set("midButton", midButton);
2296
+ }
2297
+ fixBorderStyle(style);
2298
+ tabBar.setTabBarStyle(style);
2299
+ resolve();
2300
+ }, SetTabBarStyleProtocol, SetTabBarStyleOptions);
2301
+ var hideTabBar = /* @__PURE__ */ defineAsyncApi(API_HIDE_TAB_BAR, (options, _ref) => {
2302
+ var {
2303
+ resolve,
2304
+ reject
2305
+ } = _ref;
2306
+ var tabBar = getTabBar();
2307
+ if (tabBar === null) {
2308
+ reject("tabBar is not exist");
2309
+ return;
2310
+ }
2311
+ tabBar.hideTabBar(/* @__PURE__ */ new Map([["animation", options === null || options === void 0 ? void 0 : options.animation]]));
2312
+ resolve();
2313
+ });
2314
+ var showTabBar = /* @__PURE__ */ defineAsyncApi(API_SHOW_TAB_BAR, (args, _ref) => {
2315
+ var {
2316
+ resolve,
2317
+ reject
2318
+ } = _ref;
2319
+ var tabBar = getTabBar();
2320
+ var animation2 = args && args.animation;
2321
+ if (tabBar === null) {
2322
+ reject("tabBar is not exist");
2323
+ return;
2324
+ }
2325
+ tabBar.showTabBar(/* @__PURE__ */ new Map([["animation", animation2]]));
2326
+ resolve();
2327
+ });
2328
+ var showTabBarRedDot = /* @__PURE__ */ defineAsyncApi(API_SHOW_TAB_BAR_RED_DOT, (_ref, _ref2) => {
2329
+ var {
2330
+ index: index2
2331
+ } = _ref;
2332
+ var {
1940
2333
  resolve,
1941
2334
  reject
1942
2335
  } = _ref2;
@@ -2294,21 +2687,26 @@ var createCanvasContextAsync = /* @__PURE__ */ defineAsyncApi("createCanvasConte
2294
2687
  reject("element is null");
2295
2688
  return null;
2296
2689
  }
2297
- resolve(
2298
- {
2299
- getContext: element.getContext.bind(element),
2300
- toDataURL: element.toDataURL.bind(element),
2301
- // @ts-expect-error waiting for uni-app-x type update
2302
- createImage: element.createImage.bind(element),
2303
- // @ts-expect-error waiting for uni-app-x type update
2304
- createPath2D: element.createPath2D.bind(element),
2305
- // @ts-expect-error waiting for uni-app-x type update
2306
- requestAnimationFrame: element.requestAnimationFrame.bind(element),
2307
- // @ts-expect-error waiting for uni-app-x type update
2308
- cancelAnimationFrame: element.cancelAnimationFrame.bind(element)
2309
- }
2310
- //as CanvasContext as any
2311
- );
2690
+ function createImage() {
2691
+ return new Image();
2692
+ }
2693
+ function createPath2D() {
2694
+ return new Path2D();
2695
+ }
2696
+ function requestAnimationFrameFun(callback) {
2697
+ return requestAnimationFrame(callback);
2698
+ }
2699
+ function cancelAnimationFrameFun(taskId) {
2700
+ cancelAnimationFrame(taskId);
2701
+ }
2702
+ resolve({
2703
+ getContext: element.getContext.bind(element),
2704
+ toDataURL: element.toDataURL.bind(element),
2705
+ createImage,
2706
+ createPath2D,
2707
+ requestAnimationFrame: requestAnimationFrameFun,
2708
+ cancelAnimationFrame: cancelAnimationFrameFun
2709
+ });
2312
2710
  });
2313
2711
  function queryElementTop(component, selector) {
2314
2712
  var _component$$el;
@@ -2421,32 +2819,6 @@ var stopPullDownRefresh = /* @__PURE__ */ defineAsyncApi(API_STOP_PULL_DOWN_REFR
2421
2819
  page.$nativePage.stopPullDownRefresh();
2422
2820
  res.resolve();
2423
2821
  });
2424
- var API_GET_LAUNCH_OPTIONS_SYNC = "getLaunchOptionsSync";
2425
- var launchOptions = {
2426
- path: "",
2427
- appScheme: null,
2428
- appLink: null
2429
- };
2430
- var setLaunchOptionsSync = function(options) {
2431
- launchOptions = options;
2432
- };
2433
- var getLaunchOptionsSync = /* @__PURE__ */ defineSyncApi(API_GET_LAUNCH_OPTIONS_SYNC, () => {
2434
- var baseInfo = getLaunchOptions();
2435
- return Object.assign({}, baseInfo, launchOptions);
2436
- });
2437
- var API_GET_ENTER_OPTIONS_SYNC = "getEnterOptionsSync";
2438
- var enterOptions = {
2439
- path: "",
2440
- appScheme: null,
2441
- appLink: null
2442
- };
2443
- var setEnterOptionsSync = function(options) {
2444
- enterOptions = options;
2445
- };
2446
- var getEnterOptionsSync = /* @__PURE__ */ defineSyncApi(API_GET_ENTER_OPTIONS_SYNC, () => {
2447
- var baseInfo = getLaunchOptions();
2448
- return Object.assign({}, baseInfo, enterOptions);
2449
- });
2450
2822
  var env = {
2451
2823
  USER_DATA_PATH: "unifile://usr/",
2452
2824
  CACHE_PATH: "unifile://cache/",
@@ -2754,819 +3126,557 @@ class PerformanceImpl {
2754
3126
  onPageReady((page) => {
2755
3127
  this.dispatchObserver();
2756
3128
  });
2757
- }
2758
- dispatchObserver() {
2759
- this._provider.onReady();
2760
- this._allocate.pushEntryStatus(this._provider.entryStatus);
2761
- this._provider.removeAllStatus();
2762
- }
2763
- createObserver(callback) {
2764
- return new PerformanceObserverImpl(this, callback);
2765
- }
2766
- connect(observer) {
2767
- var index2 = this._observerList.indexOf(observer);
2768
- if (index2 < 0) {
2769
- this._observerList.push(observer);
2770
- }
2771
- }
2772
- disconnect(observer) {
2773
- var index2 = this._observerList.indexOf(observer);
2774
- if (index2 >= 0) {
2775
- this._observerList.splice(index2, 1);
2776
- }
2777
- }
2778
- getEntries() {
2779
- return this._allEntryList.getEntries();
2780
- }
2781
- getEntriesByType(entryType) {
2782
- return this._allEntryList.getEntriesByType(entryType);
2783
- }
2784
- getEntriesByName(name, entryType) {
2785
- return this._allEntryList.getEntriesByName(name, entryType);
2786
- }
2787
- setBufferSize(size) {
2788
- this._allEntryList.bufferSize = size;
2789
- }
2790
- }
2791
- var getPerformance = function() {
2792
- return new PerformanceImpl();
2793
- };
2794
- var callbackId = 1;
2795
- var proxy;
2796
- var callbacks = {};
2797
- function isUniElement(obj) {
2798
- return typeof obj.getNodeId === "function" && obj.pageId;
2799
- }
2800
- function isComponentPublicInstance(instance) {
2801
- return instance && instance.$ && instance.$.proxy === instance;
2802
- }
2803
- function parseElement(obj) {
2804
- if (isUniElement(obj)) {
2805
- return obj;
2806
- } else if (isComponentPublicInstance(obj)) {
2807
- return obj.$el;
2808
- }
2809
- }
2810
- function toRaw(observed) {
2811
- var raw = observed && observed.__v_raw;
2812
- return raw ? toRaw(raw) : observed;
2813
- }
2814
- function normalizeArg(arg) {
2815
- arg = toRaw(arg);
2816
- if (typeof arg === "function") {
2817
- var oldId = Object.keys(callbacks).find((id22) => callbacks[id22] === arg);
2818
- var id2 = oldId ? parseInt(oldId) : callbackId++;
2819
- callbacks[id2] = arg;
2820
- return id2;
2821
- } else if (isPlainObject(arg)) {
2822
- var el = parseElement(arg);
2823
- if (el) {
2824
- var nodeId = "";
2825
- var pageId = "";
2826
- if (el && el.getNodeId) {
2827
- pageId = el.pageId;
2828
- nodeId = el.getNodeId();
2829
- }
2830
- return {
2831
- pageId,
2832
- nodeId
2833
- };
2834
- } else {
2835
- Object.keys(arg).forEach((name) => {
2836
- arg[name] = normalizeArg(arg[name]);
2837
- });
2838
- }
2839
- }
2840
- return arg;
2841
- }
2842
- function initUTSInstanceMethod(async, opts, instanceId, proxy2) {
2843
- return initProxyFunction("method", async, opts, instanceId, proxy2);
2844
- }
2845
- function getProxy() {
2846
- if (!proxy) {
2847
- {
2848
- proxy = {
2849
- invokeSync(args, callback) {
2850
- return nativeChannel.invokeSync("APP-SERVICE", args, callback);
2851
- },
2852
- invokeAsync(args, callback) {
2853
- if (
2854
- // 硬编码
2855
- args.moduleName === "uni-ad" && ["showByJs", "loadByJs"].includes(args.name)
2856
- ) {
2857
- var res = nativeChannel.invokeSync("APP-SERVICE", args, callback);
2858
- callback(extend(res, {
2859
- params: [res.params]
2860
- }));
2861
- return res;
2862
- }
2863
- return nativeChannel.invokeAsync("APP-SERVICE", args, callback);
2864
- }
2865
- };
2866
- }
2867
- }
2868
- return proxy;
2869
- }
2870
- function resolveSyncResult(args, res, returnOptions, instanceId, proxy2) {
2871
- if (!res) {
2872
- throw new Error("返回值为:" + JSON.stringify(res) + ";请求参数为:" + JSON.stringify(args));
2873
- }
2874
- if (isString(res)) {
2875
- try {
2876
- res = JSON.parse(res);
2877
- } catch (e) {
2878
- throw new Error("JSON.parse(".concat(res, "): ") + e);
2879
- }
2880
- }
2881
- if (res.errMsg) {
2882
- throw new Error(res.errMsg);
2883
- }
2884
- if (returnOptions) {
2885
- if (returnOptions.type === "interface" && typeof res.params === "number") {
2886
- if (!res.params) {
2887
- return null;
2888
- }
2889
- if (res.params === instanceId && proxy2) {
2890
- return proxy2;
2891
- }
2892
- if (interfaceDefines[returnOptions.options]) {
2893
- var ProxyClass = initUTSProxyClass(extend({
2894
- instanceId: res.params
2895
- }, interfaceDefines[returnOptions.options]));
2896
- return new ProxyClass();
2897
- }
2898
- }
2899
- }
2900
- return res.params;
2901
- }
2902
- function invokePropGetter(args) {
2903
- if (args.errMsg) {
2904
- throw new Error(args.errMsg);
2905
- }
2906
- delete args.errMsg;
2907
- return resolveSyncResult(args, getProxy().invokeSync(args, () => {
2908
- }));
2909
- }
2910
- function initProxyFunction(type, async, _ref, instanceId, proxy2) {
2911
- var {
2912
- moduleName,
2913
- moduleType,
2914
- package: pkg,
2915
- class: cls,
2916
- name: methodName,
2917
- method,
2918
- companion,
2919
- params: methodParams,
2920
- return: returnOptions,
2921
- errMsg
2922
- } = _ref;
2923
- var keepAlive = methodName.indexOf("on") === 0 && methodParams.length === 1 && methodParams[0].type === "UTSCallback";
2924
- var invokeCallback2 = (_ref2) => {
2925
- var {
2926
- id: id2,
2927
- name,
2928
- params
2929
- } = _ref2;
2930
- var callback = callbacks[id2];
2931
- if (callback) {
2932
- callback(...params);
2933
- if (!keepAlive) {
2934
- delete callbacks[id2];
2935
- }
2936
- } else {
2937
- console.error("".concat(pkg).concat(cls, ".").concat(methodName, " ").concat(name, " is not found"));
2938
- }
2939
- };
2940
- var baseArgs = instanceId ? {
2941
- moduleName,
2942
- moduleType,
2943
- id: instanceId,
2944
- type,
2945
- name: methodName,
2946
- method: methodParams,
2947
- keepAlive
2948
- } : {
2949
- moduleName,
2950
- moduleType,
2951
- package: pkg,
2952
- class: cls,
2953
- name: method || methodName,
2954
- type,
2955
- companion,
2956
- method: methodParams,
2957
- keepAlive
2958
- };
2959
- return function() {
2960
- if (errMsg) {
2961
- throw new Error(errMsg);
2962
- }
2963
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2964
- args[_key] = arguments[_key];
2965
- }
2966
- var invokeArgs = extend({}, baseArgs, {
2967
- params: args.map((arg) => normalizeArg(arg))
2968
- });
2969
- if (async) {
2970
- return new Promise((resolve, reject) => {
2971
- getProxy().invokeAsync(invokeArgs, (res) => {
2972
- if (res.type !== "return") {
2973
- invokeCallback2(res);
2974
- } else {
2975
- if (res.errMsg) {
2976
- reject(res.errMsg);
2977
- } else {
2978
- resolve(res.params);
2979
- }
2980
- }
2981
- });
2982
- });
3129
+ }
3130
+ dispatchObserver() {
3131
+ this._provider.onReady();
3132
+ this._allocate.pushEntryStatus(this._provider.entryStatus);
3133
+ this._provider.removeAllStatus();
3134
+ }
3135
+ createObserver(callback) {
3136
+ return new PerformanceObserverImpl(this, callback);
3137
+ }
3138
+ connect(observer) {
3139
+ var index2 = this._observerList.indexOf(observer);
3140
+ if (index2 < 0) {
3141
+ this._observerList.push(observer);
2983
3142
  }
2984
- return resolveSyncResult(invokeArgs, getProxy().invokeSync(invokeArgs, invokeCallback2), returnOptions, instanceId, proxy2);
2985
- };
2986
- }
2987
- function initUTSStaticMethod(async, opts) {
2988
- if (opts.main && !opts.method) {
2989
- if (isUTSiOS()) {
2990
- opts.method = "s_" + opts.name;
3143
+ }
3144
+ disconnect(observer) {
3145
+ var index2 = this._observerList.indexOf(observer);
3146
+ if (index2 >= 0) {
3147
+ this._observerList.splice(index2, 1);
2991
3148
  }
2992
3149
  }
2993
- return initProxyFunction("method", async, opts, 0);
2994
- }
2995
- var initUTSProxyFunction = initUTSStaticMethod;
2996
- function parseClassMethodName(name, methods) {
2997
- if (typeof name === "string" && hasOwn(methods, name + "ByJs")) {
2998
- return name + "ByJs";
3150
+ getEntries() {
3151
+ return this._allEntryList.getEntries();
3152
+ }
3153
+ getEntriesByType(entryType) {
3154
+ return this._allEntryList.getEntriesByType(entryType);
3155
+ }
3156
+ getEntriesByName(name, entryType) {
3157
+ return this._allEntryList.getEntriesByName(name, entryType);
3158
+ }
3159
+ setBufferSize(size) {
3160
+ this._allEntryList.bufferSize = size;
2999
3161
  }
3000
- return name;
3001
- }
3002
- function isUndefined(value) {
3003
- return typeof value === "undefined";
3004
3162
  }
3005
- function isProxyInterfaceOptions(options) {
3006
- return !isUndefined(options.instanceId);
3163
+ var getPerformance = function() {
3164
+ return new PerformanceImpl();
3165
+ };
3166
+ var callbackId = 1;
3167
+ var proxy;
3168
+ var callbacks = {};
3169
+ function isUniElement(obj) {
3170
+ return typeof obj.getNodeId === "function" && obj.pageId;
3007
3171
  }
3008
- function parseClassPropertySetter(name) {
3009
- return "__$set" + capitalize(name);
3172
+ function isComponentPublicInstance(instance) {
3173
+ return instance && instance.$ && instance.$.proxy === instance;
3010
3174
  }
3011
- function initUTSProxyClass(options) {
3012
- var {
3013
- moduleName,
3014
- moduleType,
3015
- package: pkg,
3016
- class: cls,
3017
- methods,
3018
- props,
3019
- setters,
3020
- errMsg
3021
- } = options;
3022
- var baseOptions = {
3023
- moduleName,
3024
- moduleType,
3025
- package: pkg,
3026
- class: cls,
3027
- errMsg
3028
- };
3029
- var instanceId;
3030
- var constructorParams = [];
3031
- var staticMethods = {};
3032
- var staticProps = [];
3033
- var staticSetters = {};
3034
- var isProxyInterface = false;
3035
- if (isProxyInterfaceOptions(options)) {
3036
- isProxyInterface = true;
3037
- instanceId = options.instanceId;
3038
- } else {
3039
- constructorParams = options.constructor.params;
3040
- staticMethods = options.staticMethods;
3041
- staticProps = options.staticProps;
3042
- staticSetters = options.staticSetters;
3043
- }
3044
- if (isUTSiOS()) {
3045
- if (constructorParams.find((p) => p.type === "UTSCallback" || p.type.indexOf("JSONObject") > 0)) {
3046
- constructorParams.push({
3047
- name: "_byJs",
3048
- type: "boolean"
3049
- });
3050
- }
3175
+ function parseElement(obj) {
3176
+ if (isUniElement(obj)) {
3177
+ return obj;
3178
+ } else if (isComponentPublicInstance(obj)) {
3179
+ return obj.$el;
3051
3180
  }
3052
- var ProxyClass = class UTSClass {
3053
- constructor() {
3054
- this.__instanceId = 0;
3055
- if (errMsg) {
3056
- throw new Error(errMsg);
3057
- }
3058
- var target = {};
3059
- if (!isProxyInterface) {
3060
- for (var _len2 = arguments.length, params = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
3061
- params[_key2] = arguments[_key2];
3062
- }
3063
- this.__instanceId = initProxyFunction("constructor", false, extend({
3064
- name: "constructor",
3065
- params: constructorParams
3066
- }, baseOptions), 0).apply(null, params);
3067
- } else if (typeof instanceId === "number") {
3068
- this.__instanceId = instanceId;
3069
- }
3070
- if (!this.__instanceId) {
3071
- throw new Error("new ".concat(cls, " is failed"));
3181
+ }
3182
+ function toRaw(observed) {
3183
+ var raw = observed && observed.__v_raw;
3184
+ return raw ? toRaw(raw) : observed;
3185
+ }
3186
+ function normalizeArg(arg) {
3187
+ arg = toRaw(arg);
3188
+ if (typeof arg === "function") {
3189
+ var oldId = Object.keys(callbacks).find((id22) => callbacks[id22] === arg);
3190
+ var id2 = oldId ? parseInt(oldId) : callbackId++;
3191
+ callbacks[id2] = arg;
3192
+ return id2;
3193
+ } else if (isPlainObject(arg)) {
3194
+ var el = parseElement(arg);
3195
+ if (el) {
3196
+ var nodeId = "";
3197
+ var pageId = "";
3198
+ if (el && el.getNodeId) {
3199
+ pageId = el.pageId;
3200
+ nodeId = el.getNodeId();
3072
3201
  }
3073
- var instance = this;
3074
- var proxy2 = new Proxy(instance, {
3075
- get(_, name) {
3076
- if (name === "__v_skip") {
3077
- return true;
3078
- }
3079
- if (!target[name]) {
3080
- name = parseClassMethodName(name, methods);
3081
- if (hasOwn(methods, name)) {
3082
- var {
3083
- async,
3084
- params: params2,
3085
- return: returnOptions
3086
- } = methods[name];
3087
- target[name] = initUTSInstanceMethod(!!async, extend({
3088
- name,
3089
- params: params2,
3090
- return: returnOptions
3091
- }, baseOptions), instance.__instanceId, proxy2);
3092
- } else if (props.includes(name)) {
3093
- return invokePropGetter({
3094
- moduleName,
3095
- moduleType,
3096
- id: instance.__instanceId,
3097
- type: "getter",
3098
- keepAlive: false,
3099
- name,
3100
- errMsg
3101
- });
3102
- }
3103
- }
3104
- return target[name];
3105
- },
3106
- set(_, name, newValue) {
3107
- if (props.includes(name)) {
3108
- var setter = parseClassPropertySetter(name);
3109
- if (!target[setter]) {
3110
- var param = setters[name];
3111
- if (param) {
3112
- target[setter] = initProxyFunction("setter", false, extend({
3113
- name,
3114
- params: [param]
3115
- }, baseOptions), instance.__instanceId, proxy2);
3116
- }
3117
- }
3118
- target[parseClassPropertySetter(name)](newValue);
3119
- return true;
3120
- }
3121
- return false;
3122
- }
3202
+ return {
3203
+ pageId,
3204
+ nodeId
3205
+ };
3206
+ } else {
3207
+ Object.keys(arg).forEach((name) => {
3208
+ arg[name] = normalizeArg(arg[name]);
3123
3209
  });
3124
- return proxy2;
3125
3210
  }
3126
- };
3127
- var staticPropSetterCache = {};
3128
- var staticMethodCache = {};
3129
- return new Proxy(ProxyClass, {
3130
- get(target, name, receiver) {
3131
- name = parseClassMethodName(name, staticMethods);
3132
- if (hasOwn(staticMethods, name)) {
3133
- if (!staticMethodCache[name]) {
3134
- var {
3135
- async,
3136
- params,
3137
- return: returnOptions
3138
- } = staticMethods[name];
3139
- staticMethodCache[name] = initUTSStaticMethod(!!async, extend({
3140
- name,
3141
- companion: true,
3142
- params,
3143
- return: returnOptions
3144
- }, baseOptions));
3145
- }
3146
- return staticMethodCache[name];
3147
- }
3148
- if (staticProps.includes(name)) {
3149
- return invokePropGetter(extend({
3150
- name,
3151
- companion: true,
3152
- type: "getter"
3153
- }, baseOptions));
3154
- }
3155
- return Reflect.get(target, name, receiver);
3156
- },
3157
- set(_, name, newValue) {
3158
- if (staticProps.includes(name)) {
3159
- var setter = parseClassPropertySetter(name);
3160
- if (!staticPropSetterCache[setter]) {
3161
- var param = staticSetters[name];
3162
- if (param) {
3163
- staticPropSetterCache[setter] = initProxyFunction("setter", false, extend({
3164
- name,
3165
- params: [param]
3166
- }, baseOptions), 0);
3211
+ }
3212
+ return arg;
3213
+ }
3214
+ function initUTSInstanceMethod(async, opts, instanceId, proxy2) {
3215
+ return initProxyFunction("method", async, opts, instanceId, proxy2);
3216
+ }
3217
+ function getProxy() {
3218
+ if (!proxy) {
3219
+ {
3220
+ proxy = {
3221
+ invokeSync(args, callback) {
3222
+ return nativeChannel.invokeSync("APP-SERVICE", args, callback);
3223
+ },
3224
+ invokeAsync(args, callback) {
3225
+ if (
3226
+ // 硬编码
3227
+ args.moduleName === "uni-ad" && ["showByJs", "loadByJs"].includes(args.name)
3228
+ ) {
3229
+ var res = nativeChannel.invokeSync("APP-SERVICE", args, callback);
3230
+ callback(extend(res, {
3231
+ params: [res.params]
3232
+ }));
3233
+ return res;
3167
3234
  }
3235
+ return nativeChannel.invokeAsync("APP-SERVICE", args, callback);
3168
3236
  }
3169
- staticPropSetterCache[parseClassPropertySetter(name)](newValue);
3170
- return true;
3171
- }
3172
- return false;
3237
+ };
3173
3238
  }
3174
- });
3175
- }
3176
- function isUTSAndroid() {
3177
- {
3178
- return false;
3179
3239
  }
3240
+ return proxy;
3180
3241
  }
3181
- function isUTSiOS() {
3182
- return !isUTSAndroid();
3183
- }
3184
- function initUTSPackageName(name, is_uni_modules) {
3185
- if (isUTSAndroid()) {
3186
- return "uts.sdk." + (is_uni_modules ? "modules." : "") + name;
3242
+ function resolveSyncResult(args, res, returnOptions, instanceId, proxy2) {
3243
+ if (!res) {
3244
+ throw new Error("返回值为:" + JSON.stringify(res) + ";请求参数为:" + JSON.stringify(args));
3187
3245
  }
3188
- return "";
3189
- }
3190
- function initUTSIndexClassName(moduleName, is_uni_modules) {
3191
- return initUTSClassName(moduleName, isUTSAndroid() ? "IndexKt" : "IndexSwift", is_uni_modules);
3192
- }
3193
- function initUTSClassName(moduleName, className, is_uni_modules) {
3194
- if (isUTSAndroid()) {
3195
- return className;
3246
+ if (isString(res)) {
3247
+ try {
3248
+ res = JSON.parse(res);
3249
+ } catch (e) {
3250
+ throw new Error("JSON.parse(".concat(res, "): ") + e);
3251
+ }
3196
3252
  }
3197
- return "UTSSDK" + (is_uni_modules ? "Modules" : "") + capitalize(moduleName) + capitalize(className);
3198
- }
3199
- var interfaceDefines = {};
3200
- function registerUTSInterface(name, define) {
3201
- interfaceDefines[name] = define;
3202
- }
3203
- var pluginDefines = {};
3204
- function registerUTSPlugin(name, define) {
3205
- pluginDefines[name] = define;
3206
- }
3207
- function requireUTSPlugin(name) {
3208
- var define = pluginDefines[name];
3209
- if (!define) {
3210
- console.error("".concat(name, " is not found"));
3253
+ if (res.errMsg) {
3254
+ throw new Error(res.errMsg);
3211
3255
  }
3212
- return define;
3213
- }
3214
- function __log__(type, filename) {
3215
- for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
3216
- args[_key - 2] = arguments[_key];
3256
+ if (returnOptions) {
3257
+ if (returnOptions.type === "interface" && typeof res.params === "number") {
3258
+ if (!res.params) {
3259
+ return null;
3260
+ }
3261
+ if (res.params === instanceId && proxy2) {
3262
+ return proxy2;
3263
+ }
3264
+ if (interfaceDefines[returnOptions.options]) {
3265
+ var ProxyClass = initUTSProxyClass(extend({
3266
+ instanceId: res.params
3267
+ }, interfaceDefines[returnOptions.options]));
3268
+ return new ProxyClass();
3269
+ }
3270
+ }
3217
3271
  }
3218
- var res = normalizeLog(type, filename, args);
3219
- res && console[type](res);
3220
- }
3221
- function isDebugMode() {
3222
- return typeof __channelId__ === "string" && __channelId__;
3272
+ return res.params;
3223
3273
  }
3224
- function jsonStringifyReplacer(k, p) {
3225
- switch (toRawType(p)) {
3226
- case "Function":
3227
- return "function() { [native code] }";
3228
- default:
3229
- return p;
3274
+ function invokePropGetter(args) {
3275
+ if (args.errMsg) {
3276
+ throw new Error(args.errMsg);
3230
3277
  }
3278
+ delete args.errMsg;
3279
+ return resolveSyncResult(args, getProxy().invokeSync(args, () => {
3280
+ }));
3231
3281
  }
3232
- function normalizeLog(type, filename, args) {
3233
- if (isDebugMode()) {
3234
- args.push(filename.replace("at ", "uni-app:///"));
3235
- return console[type].apply(console, args);
3236
- }
3237
- var msgs = args.map(function(v) {
3238
- var type2 = toTypeString(v).toLowerCase();
3239
- if (["[object object]", "[object array]", "[object module]"].indexOf(type2) !== -1) {
3240
- try {
3241
- v = "---BEGIN:JSON---" + JSON.stringify(v, jsonStringifyReplacer) + "---END:JSON---";
3242
- } catch (e) {
3243
- v = type2;
3282
+ function initProxyFunction(type, async, _ref, instanceId, proxy2) {
3283
+ var {
3284
+ moduleName,
3285
+ moduleType,
3286
+ package: pkg,
3287
+ class: cls,
3288
+ name: methodName,
3289
+ method,
3290
+ companion,
3291
+ params: methodParams,
3292
+ return: returnOptions,
3293
+ errMsg
3294
+ } = _ref;
3295
+ var keepAlive = methodName.indexOf("on") === 0 && methodParams.length === 1 && methodParams[0].type === "UTSCallback";
3296
+ var invokeCallback2 = (_ref2) => {
3297
+ var {
3298
+ id: id2,
3299
+ name,
3300
+ params
3301
+ } = _ref2;
3302
+ var callback = callbacks[id2];
3303
+ if (callback) {
3304
+ callback(...params);
3305
+ if (!keepAlive) {
3306
+ delete callbacks[id2];
3244
3307
  }
3245
3308
  } else {
3246
- if (v === null) {
3247
- v = "---NULL---";
3248
- } else if (v === void 0) {
3249
- v = "---UNDEFINED---";
3250
- } else {
3251
- var vType = toRawType(v).toUpperCase();
3252
- if (vType === "NUMBER" || vType === "BOOLEAN") {
3253
- v = "---BEGIN:" + vType + "---" + v + "---END:" + vType + "---";
3254
- } else {
3255
- v = String(v);
3256
- }
3257
- }
3309
+ console.error("".concat(pkg).concat(cls, ".").concat(methodName, " ").concat(name, " is not found"));
3258
3310
  }
3259
- return v;
3260
- });
3261
- return msgs.join("---COMMA---") + " " + filename;
3262
- }
3263
- const uni$1 = /* @__PURE__ */ Object.defineProperty({
3264
- __proto__: null,
3265
- $emit,
3266
- $off,
3267
- $on,
3268
- $once,
3269
- __log__,
3270
- addInterceptor,
3271
- createCanvasContextAsync,
3272
- createSelectorQuery,
3273
- env,
3274
- getElementById,
3275
- getEnterOptionsSync,
3276
- getLaunchOptionsSync,
3277
- getPerformance,
3278
- hideTabBar,
3279
- hideTabBarRedDot,
3280
- initUTSClassName,
3281
- initUTSIndexClassName,
3282
- initUTSPackageName,
3283
- initUTSProxyClass,
3284
- initUTSProxyFunction,
3285
- loadFontFace,
3286
- navigateBack,
3287
- navigateTo,
3288
- onTabBarMidButtonTap,
3289
- pageScrollTo,
3290
- reLaunch,
3291
- redirectTo,
3292
- registerUTSInterface,
3293
- registerUTSPlugin,
3294
- removeInterceptor,
3295
- removeTabBarBadge,
3296
- requireUTSPlugin,
3297
- setNavigationBarColor,
3298
- setNavigationBarTitle,
3299
- setTabBarBadge,
3300
- setTabBarItem,
3301
- setTabBarStyle,
3302
- showTabBar,
3303
- showTabBarRedDot,
3304
- startPullDownRefresh,
3305
- stopPullDownRefresh,
3306
- switchTab
3307
- }, Symbol.toStringTag, { value: "Module" });
3308
- function initGlobalEvent(app) {
3309
- app.addKeyEventListener(ON_BACK_BUTTON, () => {
3310
- backbuttonListener();
3311
- return true;
3312
- });
3313
- }
3314
- function loadFontFaceByStyles(styles2, global) {
3315
- styles2 = Array.isArray(styles2) ? styles2 : [styles2];
3316
- var fontFaceStyle = [];
3317
- styles2.forEach((style) => {
3318
- if (style["@FONT-FACE"]) {
3319
- fontFaceStyle.push(...style["@FONT-FACE"]);
3311
+ };
3312
+ var baseArgs = instanceId ? {
3313
+ moduleName,
3314
+ moduleType,
3315
+ id: instanceId,
3316
+ type,
3317
+ name: methodName,
3318
+ method: methodParams,
3319
+ keepAlive
3320
+ } : {
3321
+ moduleName,
3322
+ moduleType,
3323
+ package: pkg,
3324
+ class: cls,
3325
+ name: method || methodName,
3326
+ type,
3327
+ companion,
3328
+ method: methodParams,
3329
+ keepAlive
3330
+ };
3331
+ return function() {
3332
+ if (errMsg) {
3333
+ throw new Error(errMsg);
3320
3334
  }
3321
- });
3322
- if (fontFaceStyle.length === 0)
3323
- return;
3324
- fontFaceStyle.forEach((style) => {
3325
- var fontFamily = style["fontFamily"];
3326
- var fontWeight = style["fontWeight"];
3327
- var fontStyle = style["fontStyle"];
3328
- var fontVariant = style["fontVariant"];
3329
- var src = style["src"];
3330
- if (fontFamily != null && src != null) {
3331
- loadFontFace({
3332
- global,
3333
- family: fontFamily,
3334
- source: src,
3335
- desc: {
3336
- style: fontStyle,
3337
- weight: fontWeight,
3338
- variant: fontVariant
3339
- }
3335
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3336
+ args[_key] = arguments[_key];
3337
+ }
3338
+ var invokeArgs = extend({}, baseArgs, {
3339
+ params: args.map((arg) => normalizeArg(arg))
3340
+ });
3341
+ if (async) {
3342
+ return new Promise((resolve, reject) => {
3343
+ getProxy().invokeAsync(invokeArgs, (res) => {
3344
+ if (res.type !== "return") {
3345
+ invokeCallback2(res);
3346
+ } else {
3347
+ if (res.errMsg) {
3348
+ reject(res.errMsg);
3349
+ } else {
3350
+ resolve(res.params);
3351
+ }
3352
+ }
3353
+ });
3340
3354
  });
3341
- } else {
3342
- console.warn("loadFontFace: fail, font-family or src is null");
3343
3355
  }
3344
- });
3356
+ return resolveSyncResult(invokeArgs, getProxy().invokeSync(invokeArgs, invokeCallback2), returnOptions, instanceId, proxy2);
3357
+ };
3345
3358
  }
3346
- function initAppLaunch(appVm) {
3347
- injectAppHooks(appVm.$);
3348
- var {
3349
- entryPagePath,
3350
- entryPageQuery,
3351
- referrerInfo
3352
- } = __uniConfig;
3353
- var args = initLaunchOptions({
3354
- path: entryPagePath,
3355
- query: entryPageQuery,
3356
- referrerInfo
3357
- });
3358
- var app = getNativeApp();
3359
- var schemaLink = app.getLaunchOptionsSync();
3360
- var launchOption = extend({}, args, schemaLink);
3361
- setLaunchOptionsSync(launchOption);
3362
- invokeHook(appVm, ON_LAUNCH, launchOption);
3363
- var showOption = extend({}, launchOption);
3364
- setEnterOptionsSync(showOption);
3365
- invokeHook(appVm, ON_SHOW, showOption);
3366
- var appStyle = appVm.$options.styles;
3367
- if (appStyle) {
3368
- loadFontFaceByStyles(appStyle, true);
3359
+ function initUTSStaticMethod(async, opts) {
3360
+ if (opts.main && !opts.method) {
3361
+ if (isUTSiOS()) {
3362
+ opts.method = "s_" + opts.name;
3363
+ }
3369
3364
  }
3370
- useTheme();
3365
+ return initProxyFunction("method", async, opts, 0);
3371
3366
  }
3372
- var isLaunchWebviewReady = false;
3373
- function subscribeWebviewReady(_data, pageId) {
3374
- var isLaunchWebview = pageId === "1";
3375
- if (isLaunchWebview && isLaunchWebviewReady) {
3376
- return;
3377
- }
3378
- if (isLaunchWebview) {
3379
- isLaunchWebviewReady = true;
3367
+ var initUTSProxyFunction = initUTSStaticMethod;
3368
+ function parseClassMethodName(name, methods) {
3369
+ if (typeof name === "string" && hasOwn(methods, name + "ByJs")) {
3370
+ return name + "ByJs";
3380
3371
  }
3381
- isLaunchWebview && onLaunchWebviewReady();
3372
+ return name;
3382
3373
  }
3383
- function onLaunchWebviewReady() {
3384
- var entryPagePath = addLeadingSlash(__uniConfig.entryPagePath);
3385
- var routeOptions = getRouteOptions(entryPagePath);
3386
- var args = {
3387
- url: entryPagePath + (__uniConfig.entryPageQuery || ""),
3388
- openType: "appLaunch"
3389
- };
3390
- var handler = {
3391
- resolve() {
3392
- },
3393
- reject() {
3394
- }
3395
- };
3396
- if (routeOptions.meta.isTabBar) {
3397
- return $switchTab(args, handler);
3398
- }
3399
- return $navigateTo(args, handler);
3374
+ function isUndefined(value) {
3375
+ return typeof value === "undefined";
3400
3376
  }
3401
- function initSubscribeHandlers() {
3402
- subscribeWebviewReady({}, "1");
3377
+ function isProxyInterfaceOptions(options) {
3378
+ return !isUndefined(options.instanceId);
3403
3379
  }
3404
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
3405
- try {
3406
- var info = gen[key](arg);
3407
- var value = info.value;
3408
- } catch (error) {
3409
- reject(error);
3410
- return;
3411
- }
3412
- if (info.done) {
3413
- resolve(value);
3380
+ function parseClassPropertySetter(name) {
3381
+ return "__$set" + capitalize(name);
3382
+ }
3383
+ function initUTSProxyClass(options) {
3384
+ var {
3385
+ moduleName,
3386
+ moduleType,
3387
+ package: pkg,
3388
+ class: cls,
3389
+ methods,
3390
+ props,
3391
+ setters,
3392
+ errMsg
3393
+ } = options;
3394
+ var baseOptions = {
3395
+ moduleName,
3396
+ moduleType,
3397
+ package: pkg,
3398
+ class: cls,
3399
+ errMsg
3400
+ };
3401
+ var instanceId;
3402
+ var constructorParams = [];
3403
+ var staticMethods = {};
3404
+ var staticProps = [];
3405
+ var staticSetters = {};
3406
+ var isProxyInterface = false;
3407
+ if (isProxyInterfaceOptions(options)) {
3408
+ isProxyInterface = true;
3409
+ instanceId = options.instanceId;
3414
3410
  } else {
3415
- Promise.resolve(value).then(_next, _throw);
3411
+ constructorParams = options.constructor.params;
3412
+ staticMethods = options.staticMethods;
3413
+ staticProps = options.staticProps;
3414
+ staticSetters = options.staticSetters;
3416
3415
  }
3417
- }
3418
- function _asyncToGenerator(fn) {
3419
- return function() {
3420
- var self = this, args = arguments;
3421
- return new Promise(function(resolve, reject) {
3422
- var gen = fn.apply(self, args);
3423
- function _next(value) {
3424
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
3425
- }
3426
- function _throw(err) {
3427
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
3416
+ if (isUTSiOS()) {
3417
+ if (constructorParams.find((p) => p.type === "UTSCallback" || p.type.indexOf("JSONObject") > 0)) {
3418
+ constructorParams.push({
3419
+ name: "_byJs",
3420
+ type: "boolean"
3421
+ });
3422
+ }
3423
+ }
3424
+ var ProxyClass = class UTSClass {
3425
+ constructor() {
3426
+ this.__instanceId = 0;
3427
+ if (errMsg) {
3428
+ throw new Error(errMsg);
3428
3429
  }
3429
- _next(void 0);
3430
- });
3431
- };
3432
- }
3433
- function initOn(app) {
3434
- app.addEventListener(ON_SHOW, /* @__PURE__ */ function() {
3435
- var _ref = _asyncToGenerator(function* (event) {
3436
- var app2 = getNativeApp();
3437
- var MAX_TIMEOUT = 200;
3438
- function getNewIntent() {
3439
- return new Promise((resolve, reject) => {
3440
- var handleNewIntent = (newIntent) => {
3441
- var _newIntent$appScheme, _newIntent$appLink;
3442
- clearTimeout(timeout);
3443
- app2.removeEventListener("onNewIntent", handleNewIntent);
3444
- resolve({
3445
- appScheme: (_newIntent$appScheme = newIntent.appScheme) !== null && _newIntent$appScheme !== void 0 ? _newIntent$appScheme : null,
3446
- appLink: (_newIntent$appLink = newIntent.appLink) !== null && _newIntent$appLink !== void 0 ? _newIntent$appLink : null
3447
- });
3448
- };
3449
- var timeout = setTimeout(() => {
3450
- app2.removeEventListener("onNewIntent", handleNewIntent);
3451
- var appLink = {
3452
- appScheme: null,
3453
- appLink: null
3454
- };
3455
- resolve(appLink);
3456
- }, MAX_TIMEOUT);
3457
- app2.addEventListener("onNewIntent", handleNewIntent);
3458
- });
3430
+ var target = {};
3431
+ if (!isProxyInterface) {
3432
+ for (var _len2 = arguments.length, params = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
3433
+ params[_key2] = arguments[_key2];
3434
+ }
3435
+ this.__instanceId = initProxyFunction("constructor", false, extend({
3436
+ name: "constructor",
3437
+ params: constructorParams
3438
+ }, baseOptions), 0).apply(null, params);
3439
+ } else if (typeof instanceId === "number") {
3440
+ this.__instanceId = instanceId;
3459
3441
  }
3460
- var schemaLink = yield getNewIntent();
3461
- var showOptions = extend({
3462
- path: __uniConfig.entryPagePath
3463
- }, schemaLink);
3464
- setEnterOptionsSync(showOptions);
3465
- var page = getCurrentPage();
3466
- invokeHook(getApp(), ON_SHOW, showOptions);
3467
- if (page) {
3468
- invokeHook(page, ON_SHOW);
3442
+ if (!this.__instanceId) {
3443
+ throw new Error("new ".concat(cls, " is failed"));
3469
3444
  }
3470
- });
3471
- return function(_x) {
3472
- return _ref.apply(this, arguments);
3473
- };
3474
- }());
3475
- app.addEventListener(ON_HIDE, function() {
3476
- var page = getCurrentPage();
3477
- invokeHook(getApp(), ON_HIDE);
3478
- if (page) {
3479
- invokeHook(page, ON_HIDE);
3445
+ var instance = this;
3446
+ var proxy2 = new Proxy(instance, {
3447
+ get(_, name) {
3448
+ if (name === "__v_skip") {
3449
+ return true;
3450
+ }
3451
+ if (!target[name]) {
3452
+ name = parseClassMethodName(name, methods);
3453
+ if (hasOwn(methods, name)) {
3454
+ var {
3455
+ async,
3456
+ params: params2,
3457
+ return: returnOptions
3458
+ } = methods[name];
3459
+ target[name] = initUTSInstanceMethod(!!async, extend({
3460
+ name,
3461
+ params: params2,
3462
+ return: returnOptions
3463
+ }, baseOptions), instance.__instanceId, proxy2);
3464
+ } else if (props.includes(name)) {
3465
+ return invokePropGetter({
3466
+ moduleName,
3467
+ moduleType,
3468
+ id: instance.__instanceId,
3469
+ type: "getter",
3470
+ keepAlive: false,
3471
+ name,
3472
+ errMsg
3473
+ });
3474
+ }
3475
+ }
3476
+ return target[name];
3477
+ },
3478
+ set(_, name, newValue) {
3479
+ if (props.includes(name)) {
3480
+ var setter = parseClassPropertySetter(name);
3481
+ if (!target[setter]) {
3482
+ var param = setters[name];
3483
+ if (param) {
3484
+ target[setter] = initProxyFunction("setter", false, extend({
3485
+ name,
3486
+ params: [param]
3487
+ }, baseOptions), instance.__instanceId, proxy2);
3488
+ }
3489
+ }
3490
+ target[parseClassPropertySetter(name)](newValue);
3491
+ return true;
3492
+ }
3493
+ return false;
3494
+ }
3495
+ });
3496
+ return proxy2;
3480
3497
  }
3481
- });
3482
- }
3483
- function initService(app) {
3484
- initOn(app);
3485
- }
3486
- function initComponentInstance(app) {
3487
- app.mixin({
3488
- beforeCreate() {
3489
- var vm = this;
3490
- var instance = vm.$;
3491
- if (instance.type.mpType === "app") {
3492
- return;
3498
+ };
3499
+ var staticPropSetterCache = {};
3500
+ var staticMethodCache = {};
3501
+ return new Proxy(ProxyClass, {
3502
+ get(target, name, receiver) {
3503
+ name = parseClassMethodName(name, staticMethods);
3504
+ if (hasOwn(staticMethods, name)) {
3505
+ if (!staticMethodCache[name]) {
3506
+ var {
3507
+ async,
3508
+ params,
3509
+ return: returnOptions
3510
+ } = staticMethods[name];
3511
+ staticMethodCache[name] = initUTSStaticMethod(!!async, extend({
3512
+ name,
3513
+ companion: true,
3514
+ params,
3515
+ return: returnOptions
3516
+ }, baseOptions));
3517
+ }
3518
+ return staticMethodCache[name];
3493
3519
  }
3494
- var pageId = instance.root.attrs.__pageId;
3495
- vm.$nativePage = getNativeApp().pageManager.findPageById(pageId + "");
3520
+ if (staticProps.includes(name)) {
3521
+ return invokePropGetter(extend({
3522
+ name,
3523
+ companion: true,
3524
+ type: "getter"
3525
+ }, baseOptions));
3526
+ }
3527
+ return Reflect.get(target, name, receiver);
3496
3528
  },
3497
- beforeMount() {
3498
- var _vm$$options$styles;
3499
- var vm = this;
3500
- var instance = vm.$;
3501
- if (instance.type.mpType === "app") {
3502
- return;
3529
+ set(_, name, newValue) {
3530
+ if (staticProps.includes(name)) {
3531
+ var setter = parseClassPropertySetter(name);
3532
+ if (!staticPropSetterCache[setter]) {
3533
+ var param = staticSetters[name];
3534
+ if (param) {
3535
+ staticPropSetterCache[setter] = initProxyFunction("setter", false, extend({
3536
+ name,
3537
+ params: [param]
3538
+ }, baseOptions), 0);
3539
+ }
3540
+ }
3541
+ staticPropSetterCache[parseClassPropertySetter(name)](newValue);
3542
+ return true;
3503
3543
  }
3504
- loadFontFaceByStyles((_vm$$options$styles = vm.$options.styles) !== null && _vm$$options$styles !== void 0 ? _vm$$options$styles : [], false);
3544
+ return false;
3505
3545
  }
3506
3546
  });
3507
3547
  }
3508
- var appCtx;
3509
- var defaultApp = {
3510
- globalData: {}
3511
- };
3512
- function initAppVm(appVm) {
3513
- appVm.$vm = appVm;
3514
- appVm.$mpType = "app";
3548
+ function isUTSAndroid() {
3549
+ {
3550
+ return false;
3551
+ }
3515
3552
  }
3516
- function getApp$1() {
3517
- var {
3518
- allowDefault = false
3519
- } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
3520
- if (appCtx) {
3521
- return appCtx;
3553
+ function isUTSiOS() {
3554
+ return !isUTSAndroid();
3555
+ }
3556
+ function initUTSPackageName(name, is_uni_modules) {
3557
+ if (isUTSAndroid()) {
3558
+ return "uts.sdk." + (is_uni_modules ? "modules." : "") + name;
3522
3559
  }
3523
- if (allowDefault) {
3524
- return defaultApp;
3560
+ return "";
3561
+ }
3562
+ function initUTSIndexClassName(moduleName, is_uni_modules) {
3563
+ return initUTSClassName(moduleName, isUTSAndroid() ? "IndexKt" : "IndexSwift", is_uni_modules);
3564
+ }
3565
+ function initUTSClassName(moduleName, className, is_uni_modules) {
3566
+ if (isUTSAndroid()) {
3567
+ return className;
3525
3568
  }
3526
- console.error("[warn]: getApp() failed. Learn more: https://uniapp.dcloud.io/collocation/frame/window?id=getapp.");
3569
+ return "UTSSDK" + (is_uni_modules ? "Modules" : "") + capitalize(moduleName) + capitalize(className);
3527
3570
  }
3528
- function registerApp(appVm, nativeApp2) {
3529
- initEntryPagePath(nativeApp2);
3530
- setNativeApp(nativeApp2);
3531
- initVueApp(appVm);
3532
- appCtx = appVm;
3533
- initAppVm(appCtx);
3534
- extend(appCtx, defaultApp);
3535
- defineGlobalData(appCtx, defaultApp.globalData);
3536
- initService(nativeApp2);
3537
- initGlobalEvent(nativeApp2);
3538
- initAppLaunch(appVm);
3539
- initSubscribeHandlers();
3540
- __uniConfig.ready = true;
3571
+ var interfaceDefines = {};
3572
+ function registerUTSInterface(name, define) {
3573
+ interfaceDefines[name] = define;
3541
3574
  }
3542
- function initApp(app) {
3543
- initComponentInstance(app);
3575
+ var pluginDefines = {};
3576
+ function registerUTSPlugin(name, define) {
3577
+ pluginDefines[name] = define;
3544
3578
  }
3545
- function initEntryPagePath(app) {
3546
- var redirectInfo = app.getRedirectInfo();
3547
- var debugInfo = redirectInfo.get("debug");
3548
- if (debugInfo) {
3549
- var url = debugInfo.get("url");
3550
- if (url && url != __uniConfig.entryPagePath) {
3551
- __uniConfig.realEntryPagePath = __uniConfig.entryPagePath;
3552
- var [path, query] = url.split("?");
3553
- __uniConfig.entryPagePath = path;
3554
- if (query) {
3555
- __uniConfig.entryPageQuery = "?".concat(query);
3556
- }
3557
- return;
3558
- }
3579
+ function requireUTSPlugin(name) {
3580
+ var define = pluginDefines[name];
3581
+ if (!define) {
3582
+ console.error("".concat(name, " is not found"));
3559
3583
  }
3560
- if (__uniConfig.conditionUrl) {
3561
- __uniConfig.realEntryPagePath = __uniConfig.entryPagePath;
3562
- var conditionUrl = __uniConfig.conditionUrl;
3563
- var [_path, _query] = conditionUrl.split("?");
3564
- __uniConfig.entryPagePath = _path;
3565
- if (_query) {
3566
- __uniConfig.entryPageQuery = "?".concat(_query);
3567
- }
3584
+ return define;
3585
+ }
3586
+ function __log__(type, filename) {
3587
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
3588
+ args[_key - 2] = arguments[_key];
3589
+ }
3590
+ var res = normalizeLog(type, filename, args);
3591
+ res && console[type](res);
3592
+ }
3593
+ function isDebugMode() {
3594
+ return typeof __channelId__ === "string" && __channelId__;
3595
+ }
3596
+ function jsonStringifyReplacer(k, p) {
3597
+ switch (toRawType(p)) {
3598
+ case "Function":
3599
+ return "function() { [native code] }";
3600
+ default:
3601
+ return p;
3602
+ }
3603
+ }
3604
+ function normalizeLog(type, filename, args) {
3605
+ if (isDebugMode()) {
3606
+ args.push(filename.replace("at ", "uni-app:///"));
3607
+ return console[type].apply(console, args);
3568
3608
  }
3609
+ var msgs = args.map(function(v) {
3610
+ var type2 = toTypeString(v).toLowerCase();
3611
+ if (["[object object]", "[object array]", "[object module]"].indexOf(type2) !== -1) {
3612
+ try {
3613
+ v = "---BEGIN:JSON---" + JSON.stringify(v, jsonStringifyReplacer) + "---END:JSON---";
3614
+ } catch (e) {
3615
+ v = type2;
3616
+ }
3617
+ } else {
3618
+ if (v === null) {
3619
+ v = "---NULL---";
3620
+ } else if (v === void 0) {
3621
+ v = "---UNDEFINED---";
3622
+ } else {
3623
+ var vType = toRawType(v).toUpperCase();
3624
+ if (vType === "NUMBER" || vType === "BOOLEAN") {
3625
+ v = "---BEGIN:" + vType + "---" + v + "---END:" + vType + "---";
3626
+ } else {
3627
+ v = String(v);
3628
+ }
3629
+ }
3630
+ }
3631
+ return v;
3632
+ });
3633
+ return msgs.join("---COMMA---") + " " + filename;
3569
3634
  }
3635
+ const uni$1 = /* @__PURE__ */ Object.defineProperty({
3636
+ __proto__: null,
3637
+ $emit,
3638
+ $off,
3639
+ $on,
3640
+ $once,
3641
+ __log__,
3642
+ addInterceptor,
3643
+ createCanvasContextAsync,
3644
+ createSelectorQuery,
3645
+ env,
3646
+ getElementById,
3647
+ getEnterOptionsSync,
3648
+ getLaunchOptionsSync,
3649
+ getPerformance,
3650
+ hideTabBar,
3651
+ hideTabBarRedDot,
3652
+ initUTSClassName,
3653
+ initUTSIndexClassName,
3654
+ initUTSPackageName,
3655
+ initUTSProxyClass,
3656
+ initUTSProxyFunction,
3657
+ loadFontFace,
3658
+ navigateBack,
3659
+ navigateTo,
3660
+ onTabBarMidButtonTap,
3661
+ pageScrollTo,
3662
+ reLaunch,
3663
+ redirectTo,
3664
+ registerUTSInterface,
3665
+ registerUTSPlugin,
3666
+ removeInterceptor,
3667
+ removeTabBarBadge,
3668
+ requireUTSPlugin,
3669
+ setNavigationBarColor,
3670
+ setNavigationBarTitle,
3671
+ setTabBarBadge,
3672
+ setTabBarItem,
3673
+ setTabBarStyle,
3674
+ showTabBar,
3675
+ showTabBarRedDot,
3676
+ startPullDownRefresh,
3677
+ stopPullDownRefresh,
3678
+ switchTab
3679
+ }, Symbol.toStringTag, { value: "Module" });
3570
3680
  function converPx(value) {
3571
3681
  if (/^-?\d+[ur]px$/i.test(value)) {
3572
3682
  return value.replace(/(^-?\d+)[ur]px$/i, (text, num) => {