@paypay/mini-app-js-sdk 1.25.0 → 1.26.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.
@@ -65,7 +65,7 @@ function normalizeNativeResponseData(data2) {
65
65
  }
66
66
  class JsBridge {
67
67
  constructor(global2) {
68
- this.version = "1.25.0";
68
+ this.version = "1.26.0";
69
69
  this.messageHandlers = new Map();
70
70
  this.responseCallbacks = new Map();
71
71
  this.global = global2;
@@ -1244,6 +1244,13 @@ const getPaymentMethods = (params) => {
1244
1244
  params
1245
1245
  });
1246
1246
  };
1247
+ const getPaymentMethods2 = (params) => {
1248
+ return ppFetch2({
1249
+ method: "GET",
1250
+ url: "web-api/app/v2/payment/methods",
1251
+ params
1252
+ });
1253
+ };
1247
1254
  const makePayment$1 = async (queryParams, body, isAuthorization) => {
1248
1255
  var _a, _b, _c, _d, _e, _f, _g;
1249
1256
  const url = isAuthorization ? "web-api/app/v1/payment/preauthorize" : "web-api/app/v1/payment";
@@ -1344,12 +1351,6 @@ function trigger$2(target, type) {
1344
1351
  inputEvent.initEvent(type, true, true);
1345
1352
  target.dispatchEvent(inputEvent);
1346
1353
  }
1347
- function isObject$1(val2) {
1348
- return val2 !== null && typeof val2 === "object";
1349
- }
1350
- function isPromise$1(val2) {
1351
- return isObject$1(val2) && isFunction$1(val2.then) && isFunction$1(val2.catch);
1352
- }
1353
1354
  function checkDuplicateTopup(amount2) {
1354
1355
  try {
1355
1356
  if (getLastTopup()) {
@@ -1517,7 +1518,7 @@ const opaUrl = () => {
1517
1518
  const createHeaderMiniAppApi = (urlEndpoint, customHeaders) => {
1518
1519
  let headers = new Headers(__spreadValues({
1519
1520
  "Content-Type": "application/json",
1520
- "Client-Version": "1.25.0",
1521
+ "Client-Version": "1.26.0",
1521
1522
  "Client-OS-Type": getRuntime()
1522
1523
  }, customHeaders));
1523
1524
  if (urlEndpoint === "web-api/app/v2/payment/methods" || urlEndpoint === "web-api/app/v2/payment/consult" || urlEndpoint === "web-api/app/v1/payment/cashbackDetail" || urlEndpoint === "web-api/app/v1/confirmAgeForCashback" || urlEndpoint === "web-api/app/v1/internal/request" || urlEndpoint === "web-api/app/v1/addressbyzip" || urlEndpoint === "/web-api/app/platform/v1/balance") {
@@ -1547,7 +1548,7 @@ function addParams(params) {
1547
1548
  }
1548
1549
  return paramString;
1549
1550
  }
1550
- function ppFetch(options) {
1551
+ function ppFetchPrepare(options) {
1551
1552
  if (!options.params) {
1552
1553
  options.params = {};
1553
1554
  }
@@ -1555,20 +1556,10 @@ function ppFetch(options) {
1555
1556
  const requestInfo = `${opaUrl()}${options.url}${addParams(options.params)}`;
1556
1557
  const { timeout = 3e4 } = options;
1557
1558
  let controller = new AbortController();
1558
- let id;
1559
+ window.setTimeout(() => controller.abort(), timeout);
1559
1560
  const headers = createHeaderMiniAppApi(options.url, options.headers);
1560
1561
  if (!headers) {
1561
- const msg = "PayPay Mini App JS SDK is not initialized";
1562
- console.warn(msg);
1563
- return Promise.resolve({
1564
- error: {
1565
- message: msg
1566
- }
1567
- });
1568
- }
1569
- try {
1570
- id = setTimeout(() => controller.abort(), timeout);
1571
- } catch (_) {
1562
+ return null;
1572
1563
  }
1573
1564
  let requestInit = {
1574
1565
  method: options.method,
@@ -1578,7 +1569,22 @@ function ppFetch(options) {
1578
1569
  if (["POST", "PUT"].includes(options.method) && options.data) {
1579
1570
  requestInit.body = JSON.stringify(options.data);
1580
1571
  }
1581
- return fetch(requestInfo, requestInit).then(async (response) => {
1572
+ return { requestInfo, requestInit };
1573
+ }
1574
+ async function ppFetch(options) {
1575
+ const fetchParams = ppFetchPrepare(options);
1576
+ if (!fetchParams) {
1577
+ const msg = "PayPay Mini App JS SDK is not initialized";
1578
+ console.warn(msg);
1579
+ return Promise.resolve({
1580
+ error: {
1581
+ message: msg
1582
+ }
1583
+ });
1584
+ }
1585
+ const { requestInfo, requestInit } = fetchParams;
1586
+ try {
1587
+ const response = await fetch(requestInfo, requestInit);
1582
1588
  const res = await response.json();
1583
1589
  if (res.error === "invalid_token" && !options.suppressRefresh) {
1584
1590
  if (await refreshToken()) {
@@ -1586,20 +1592,79 @@ function ppFetch(options) {
1586
1592
  }
1587
1593
  }
1588
1594
  return __spreadProps(__spreadValues({}, res), { statusCode: response == null ? void 0 : response.status });
1589
- }).catch((error) => {
1590
- if (error.name === "AbortError") {
1595
+ } catch (error) {
1596
+ if (error instanceof Error && error.name === "AbortError") {
1591
1597
  return {
1592
1598
  error: { message: MiniAppErrorType.timeOut }
1593
1599
  };
1594
1600
  }
1595
- return { error: "Request failed." };
1596
- }).finally(() => {
1597
- clearTimeout(id);
1598
- });
1601
+ return { error: { message: "Request failed." } };
1602
+ }
1603
+ }
1604
+ async function ppFetch2(options) {
1605
+ var _a, _b, _c, _d, _e;
1606
+ const fetchParams = ppFetchPrepare(options);
1607
+ if (!fetchParams) {
1608
+ const msg = "PayPay Mini App JS SDK is not initialized";
1609
+ console.warn(msg);
1610
+ return Promise.resolve({
1611
+ ppFetchResult: "notInitialized",
1612
+ body: null
1613
+ });
1614
+ }
1615
+ const { requestInfo, requestInit } = fetchParams;
1616
+ try {
1617
+ const response = await fetch(requestInfo, requestInit);
1618
+ const res = await response.json();
1619
+ const tokenResponse = res;
1620
+ if (tokenResponse.error === "invalid_token" && !options.suppressRefresh) {
1621
+ if (await refreshToken()) {
1622
+ return ppFetch2(__spreadProps(__spreadValues({}, options), { suppressRefresh: true }));
1623
+ }
1624
+ }
1625
+ const opaResponse = res;
1626
+ if (opaResponse.unsigned) {
1627
+ if (((_a = opaResponse.unsigned.resultInfo) == null ? void 0 : _a.code) !== "SUCCESS") {
1628
+ return {
1629
+ ppFetchResult: "apiError",
1630
+ statusCode: response.status,
1631
+ body: opaResponse
1632
+ };
1633
+ }
1634
+ } else if (((_b = opaResponse.resultInfo) == null ? void 0 : _b.code) !== "SUCCESS") {
1635
+ return {
1636
+ ppFetchResult: "apiError",
1637
+ statusCode: response.status,
1638
+ body: opaResponse
1639
+ };
1640
+ }
1641
+ if (((_e = (_d = (_c = opaResponse.unsigned) == null ? void 0 : _c.data) == null ? void 0 : _d.header) == null ? void 0 : _e.resultCode) && opaResponse.unsigned.data.header.resultCode !== "S0000") {
1642
+ return {
1643
+ ppFetchResult: "apiError",
1644
+ statusCode: response.status,
1645
+ body: opaResponse
1646
+ };
1647
+ }
1648
+ return {
1649
+ ppFetchResult: "success",
1650
+ statusCode: response.status,
1651
+ body: res
1652
+ };
1653
+ } catch (error) {
1654
+ if (error instanceof Error && error.name === "AbortError") {
1655
+ return {
1656
+ ppFetchResult: "timeout",
1657
+ body: null
1658
+ };
1659
+ }
1660
+ return {
1661
+ ppFetchResult: "fetchError",
1662
+ body: null
1663
+ };
1664
+ }
1599
1665
  }
1600
1666
  async function refreshToken() {
1601
- var _a, _b, _c;
1602
- const res = await ppFetch({
1667
+ const res = await ppFetch2({
1603
1668
  method: "POST",
1604
1669
  url: "web-api/app/token/v1/refresh",
1605
1670
  data: {
@@ -1607,13 +1672,13 @@ async function refreshToken() {
1607
1672
  },
1608
1673
  suppressRefresh: true
1609
1674
  });
1610
- if (!res || "error" in res) {
1611
- return false;
1612
- }
1613
- if (((_a = res == null ? void 0 : res.resultInfo) == null ? void 0 : _a.code) === "SUCCESS") {
1614
- saveAccessToken(((_b = res == null ? void 0 : res.data) == null ? void 0 : _b.accessToken) || "");
1615
- saveRefreshToken(((_c = res == null ? void 0 : res.data) == null ? void 0 : _c.refreshToken) || "");
1616
- return true;
1675
+ if (res.ppFetchResult === "success") {
1676
+ const data2 = res.body.data;
1677
+ if ((data2 == null ? void 0 : data2.accessToken) && data2.refreshToken) {
1678
+ saveAccessToken(data2.accessToken);
1679
+ saveRefreshToken(data2.refreshToken);
1680
+ return true;
1681
+ }
1617
1682
  }
1618
1683
  return false;
1619
1684
  }
@@ -1640,8 +1705,11 @@ async function initAppDetail(accessToken) {
1640
1705
  return true;
1641
1706
  }
1642
1707
  function getAppDetail() {
1643
- const res = JSON.parse(getAppDetail$1() || "{}");
1644
- return res;
1708
+ const json = getAppDetail$1();
1709
+ if (json) {
1710
+ return JSON.parse(json);
1711
+ }
1712
+ return null;
1645
1713
  }
1646
1714
  async function initAppConfiguration() {
1647
1715
  const res = await ppFetch({
@@ -1660,7 +1728,11 @@ async function initAppConfiguration() {
1660
1728
  return true;
1661
1729
  }
1662
1730
  function getAppConfig() {
1663
- return JSON.parse(getAppConfig$1() || "{}");
1731
+ const config = getAppConfig$1();
1732
+ if (config) {
1733
+ return JSON.parse(config);
1734
+ }
1735
+ return null;
1664
1736
  }
1665
1737
  function reconstructParams(params) {
1666
1738
  if (!params)
@@ -1889,7 +1961,7 @@ const PermissionName = {
1889
1961
  };
1890
1962
  const checkPermission = async (permissionNames) => {
1891
1963
  var _a;
1892
- if ((_a = JSON.parse(getAppDetail$1() || "{}")) == null ? void 0 : _a.isInternal) {
1964
+ if ((_a = getAppDetail()) == null ? void 0 : _a.isInternal) {
1893
1965
  return PermissionStatus.granted;
1894
1966
  }
1895
1967
  const resPermission = await getUserGrantedPermission();
@@ -1945,13 +2017,13 @@ async function getKycInformation(params) {
1945
2017
  await execute$9(params);
1946
2018
  }
1947
2019
  async function execute$9(params) {
1948
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
2020
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1949
2021
  try {
1950
2022
  const grantStatus = await checkPermission(PermissionName.mini_app_kyc);
1951
2023
  if (grantStatus !== PermissionStatus.granted) {
1952
2024
  return (_a = params == null ? void 0 : params.fail) == null ? void 0 : _a.call(params, { errorCode: MiniAppErrorType.insufficientScope });
1953
2025
  }
1954
- const res = await ppFetch({
2026
+ const res = await ppFetch2({
1955
2027
  method: "GET",
1956
2028
  url: "web-api/app/v2/users/kyc",
1957
2029
  params: {
@@ -1959,18 +2031,18 @@ async function execute$9(params) {
1959
2031
  eKycDocuments: (_b = params.eKycDocuments) == null ? void 0 : _b.toString()
1960
2032
  }
1961
2033
  });
1962
- if (!res || "error" in res) {
2034
+ if (res.ppFetchResult !== "success") {
1963
2035
  return (_c = params == null ? void 0 : params.fail) == null ? void 0 : _c.call(params, { errorCode: MiniAppErrorType.serverError });
1964
2036
  }
1965
- if ((_d = res == null ? void 0 : res.unsigned) == null ? void 0 : _d.data) {
1966
- let response = (_e = res == null ? void 0 : res.unsigned) == null ? void 0 : _e.data;
1967
- response.jws = (_f = res == null ? void 0 : res.signed) == null ? void 0 : _f.jws;
1968
- return (_g = params == null ? void 0 : params.success) == null ? void 0 : _g.call(params, response);
2037
+ if ((_d = res.body.unsigned) == null ? void 0 : _d.data) {
2038
+ let response = res.body.unsigned.data;
2039
+ response.jws = (_e = res.body.signed) == null ? void 0 : _e.jws;
2040
+ return (_f = params == null ? void 0 : params.success) == null ? void 0 : _f.call(params, response);
1969
2041
  } else {
1970
- return (_h = params == null ? void 0 : params.fail) == null ? void 0 : _h.call(params, { errorCode: MiniAppErrorType.serverError });
2042
+ return (_g = params == null ? void 0 : params.fail) == null ? void 0 : _g.call(params, { errorCode: MiniAppErrorType.serverError });
1971
2043
  }
1972
2044
  } catch {
1973
- return (_i = params == null ? void 0 : params.fail) == null ? void 0 : _i.call(params, { errorCode: MiniAppErrorType.serverError });
2045
+ return (_h = params == null ? void 0 : params.fail) == null ? void 0 : _h.call(params, { errorCode: MiniAppErrorType.serverError });
1974
2046
  }
1975
2047
  }
1976
2048
  async function getPermissionStatus(params) {
@@ -7626,19 +7698,7 @@ const Divider = defineComponent({
7626
7698
  }, null);
7627
7699
  }
7628
7700
  });
7629
- function isEmptyValue(value2) {
7630
- if (Array.isArray(value2)) {
7631
- return !value2.length;
7632
- }
7633
- if (value2 === 0) {
7634
- return false;
7635
- }
7636
- return !value2;
7637
- }
7638
7701
  function runSyncRule(value2, rule) {
7639
- if (rule.required && isEmptyValue(value2)) {
7640
- return false;
7641
- }
7642
7702
  if (rule.pattern && !rule.pattern.test(String(value2))) {
7643
7703
  return false;
7644
7704
  }
@@ -7668,11 +7728,6 @@ const Input = defineComponent({
7668
7728
  required: false,
7669
7729
  default: "sm"
7670
7730
  },
7671
- formatter: {
7672
- type: Function,
7673
- required: false,
7674
- default: (v) => v
7675
- },
7676
7731
  autofocus: {
7677
7732
  type: Boolean,
7678
7733
  required: false,
@@ -7728,11 +7783,6 @@ const Input = defineComponent({
7728
7783
  required: false,
7729
7784
  default: () => [{}]
7730
7785
  },
7731
- formatTrigger: {
7732
- type: String,
7733
- required: false,
7734
- default: "onChange"
7735
- },
7736
7786
  validateTrigger: {
7737
7787
  type: String,
7738
7788
  required: false,
@@ -7777,9 +7827,10 @@ const Input = defineComponent({
7777
7827
  const state = reactive({
7778
7828
  focused: false,
7779
7829
  validateFailed: false,
7780
- validateMessage: ""
7830
+ validateMessage: "",
7831
+ isComposing: false
7781
7832
  });
7782
- const updateValue = (_value, trigger2 = "onChange") => {
7833
+ const updateValue = (_value) => {
7783
7834
  var _a;
7784
7835
  let value2 = isDef(_value) ? String(_value) : "";
7785
7836
  const {
@@ -7805,9 +7856,6 @@ const Input = defineComponent({
7805
7856
  allowMinus: isNumber
7806
7857
  });
7807
7858
  }
7808
- if (props.formatter && trigger2 === props.formatTrigger) {
7809
- value2 = props.formatter(value2);
7810
- }
7811
7859
  if ((inputRef == null ? void 0 : inputRef.value) && value2 !== ((_a = inputRef == null ? void 0 : inputRef.value) == null ? void 0 : _a.value)) {
7812
7860
  inputRef.value.value = value2;
7813
7861
  }
@@ -7818,7 +7866,7 @@ const Input = defineComponent({
7818
7866
  const onInput = (event) => {
7819
7867
  const target = event.target;
7820
7868
  const cursorPosition = target.selectionStart;
7821
- if (!target.composing) {
7869
+ if (!state.isComposing) {
7822
7870
  updateValue(target.value);
7823
7871
  emit("input", event);
7824
7872
  }
@@ -7834,18 +7882,17 @@ const Input = defineComponent({
7834
7882
  emit("focus", event);
7835
7883
  };
7836
7884
  const onBlur = (event) => {
7837
- updateValue(props.modelValue, "onBlur");
7885
+ updateValue(props.modelValue);
7838
7886
  emit("blur", event);
7839
7887
  validateWithTrigger("onBlur");
7840
7888
  };
7841
- const onCompositionStart2 = (event) => {
7842
- event.target.composing = true;
7889
+ const onCompositionStart2 = () => {
7890
+ state.isComposing = true;
7843
7891
  };
7844
7892
  const onCompositionEnd2 = (event) => {
7845
- const target = event.target;
7846
- if (target.composing) {
7847
- target.composing = false;
7848
- trigger$2(target, "input");
7893
+ if (state.isComposing) {
7894
+ state.isComposing = false;
7895
+ trigger$2(event.target, "input");
7849
7896
  }
7850
7897
  };
7851
7898
  const resetValidation = () => {
@@ -7854,16 +7901,6 @@ const Input = defineComponent({
7854
7901
  state.validateMessage = "";
7855
7902
  }
7856
7903
  };
7857
- const runValidator = (value2, rule) => new Promise((resolve2) => {
7858
- void (async () => {
7859
- var _a;
7860
- const returnVal = (_a = rule == null ? void 0 : rule.validator) == null ? void 0 : _a.call(rule, value2, rule);
7861
- if (isPromise$1(returnVal)) {
7862
- return await returnVal.then(resolve2);
7863
- }
7864
- resolve2(returnVal);
7865
- })();
7866
- });
7867
7904
  const validate2 = (rules = props.rules) => new Promise((resolve2) => {
7868
7905
  if (!rules) {
7869
7906
  resolve2(null);
@@ -7885,10 +7922,7 @@ const Input = defineComponent({
7885
7922
  const validateWithTrigger = (trigger2) => {
7886
7923
  if (props.rules) {
7887
7924
  const defaultTrigger = props.validateTrigger === trigger2;
7888
- const rules = props.rules.filter((rule) => {
7889
- if (rule.trigger) {
7890
- return rule.trigger === trigger2;
7891
- }
7925
+ const rules = props.rules.filter(() => {
7892
7926
  return defaultTrigger;
7893
7927
  });
7894
7928
  void validate2(rules);
@@ -7899,25 +7933,11 @@ const Input = defineComponent({
7899
7933
  return;
7900
7934
  }
7901
7935
  let value2 = String(props.modelValue);
7902
- if (rule.formatter) {
7903
- value2 = rule.formatter(value2, rule);
7904
- }
7905
7936
  if (!runSyncRule(value2, rule)) {
7906
7937
  state.validateFailed = true;
7907
7938
  state.validateMessage = getRuleMessage(value2, rule);
7908
7939
  return;
7909
7940
  }
7910
- if (rule.validator) {
7911
- return runValidator(value2, rule).then((result2) => {
7912
- if (result2 && typeof result2 === "string") {
7913
- state.validateFailed = true;
7914
- state.validateMessage = result2;
7915
- } else if (result2 === false) {
7916
- state.validateFailed = true;
7917
- state.validateMessage = getRuleMessage(value2, rule);
7918
- }
7919
- });
7920
- }
7921
7941
  }), Promise.resolve());
7922
7942
  const renderMessage = () => {
7923
7943
  const message = props.errorMessage || state.validateMessage;
@@ -19904,7 +19924,7 @@ const Header = defineComponent({
19904
19924
  })}`,
19905
19925
  "style": headerStyle.value
19906
19926
  }, [createVNode("div", {
19907
- "data-test": "header-close",
19927
+ "data-testid": "header-close",
19908
19928
  "onClick": () => emit("click")
19909
19929
  }, [createVNode("i", {
19910
19930
  "class": `${styles$2.icon} ${styles$2[props.icon]}`
@@ -19912,6 +19932,7 @@ const Header = defineComponent({
19912
19932
  "class": `${styles$2.text} ${props.titleClassName} ${props.rightIcon ? styles$2.iconRightText : ""}`
19913
19933
  }, [props.title]), props.rightIcon && createVNode("div", null, [createVNode("i", {
19914
19934
  "class": `${styles$2.iconRight} ${styles$2[props.rightIcon]}`,
19935
+ "data-testid": "header-right-button",
19915
19936
  "onClick": () => emit("right-click")
19916
19937
  }, null)])]);
19917
19938
  }
@@ -22343,7 +22364,7 @@ const _sfc_main$L = defineComponent({
22343
22364
  };
22344
22365
  }
22345
22366
  });
22346
- const _hoisted_1$s = { "data-test": "address-title" };
22367
+ const _hoisted_1$s = { "data-testid": "address-title" };
22347
22368
  const _hoisted_2$h = /* @__PURE__ */ createTextVNode("\u7DE8\u96C6");
22348
22369
  function _sfc_render$L(_ctx, _cache, $props, $setup, $data, $options) {
22349
22370
  const _component_Button = resolveComponent("Button");
@@ -22352,7 +22373,7 @@ function _sfc_render$L(_ctx, _cache, $props, $setup, $data, $options) {
22352
22373
  }, [
22353
22374
  createBaseVNode("div", {
22354
22375
  class: normalizeClass(_ctx.style.addressContainer),
22355
- "data-test": "address-container",
22376
+ "data-testid": "address-container",
22356
22377
  onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("select"))
22357
22378
  }, [
22358
22379
  createBaseVNode("div", {
@@ -22362,11 +22383,11 @@ function _sfc_render$L(_ctx, _cache, $props, $setup, $data, $options) {
22362
22383
  ], 2),
22363
22384
  createBaseVNode("div", {
22364
22385
  class: normalizeClass([_ctx.style.text]),
22365
- "data-test": "address-postal-code"
22386
+ "data-testid": "address-postal-code"
22366
22387
  }, toDisplayString(_ctx.postalCode), 3),
22367
22388
  createBaseVNode("div", {
22368
22389
  class: normalizeClass([_ctx.style.text]),
22369
- "data-test": "address-address-text"
22390
+ "data-testid": "address-address-text"
22370
22391
  }, toDisplayString(_ctx.addressText), 3),
22371
22392
  _ctx.address.street2 ? (openBlock(), createElementBlock("div", {
22372
22393
  key: 0,
@@ -22498,6 +22519,7 @@ function _sfc_render$K(_ctx, _cache, $props, $setup, $data, $options) {
22498
22519
  ], 2),
22499
22520
  createBaseVNode("div", {
22500
22521
  class: normalizeClass(_ctx.style.rootUa),
22522
+ "data-testid": "get-user-address-footer-buttons",
22501
22523
  onClick: _cache[1] || (_cache[1] = (...args) => _ctx.confirm && _ctx.confirm(...args))
22502
22524
  }, [
22503
22525
  createVNode(_component_Button, {
@@ -23710,7 +23732,7 @@ const createInitialState$1 = (address2) => {
23710
23732
  const visibilities = {};
23711
23733
  formKeys.forEach((keyName) => {
23712
23734
  var _a;
23713
- const formValue = keyName === "tags" ? (_a = address2[keyName]) != null ? _a : [] : address2[keyName];
23735
+ const formValue = keyName === "tags" ? (_a = address2.tags) != null ? _a : [] : address2[keyName];
23714
23736
  formValues[keyName] = formValue != null ? formValue : "";
23715
23737
  visibilities[keyName] = kyc ? !!formValue : true;
23716
23738
  });
@@ -23813,7 +23835,7 @@ const _sfc_main$C = defineComponent({
23813
23835
  });
23814
23836
  const submit = () => {
23815
23837
  const plainState = __spreadValues({}, state);
23816
- plainState.zip = plainState.zip.replaceAll("-", "");
23838
+ plainState.zip = plainState.zip.replace(/-/g, "");
23817
23839
  delete plainState.visibilities;
23818
23840
  emit("submit", plainState);
23819
23841
  };
@@ -23852,7 +23874,7 @@ function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) {
23852
23874
  id: "content-title",
23853
23875
  modelValue: _ctx.state.title,
23854
23876
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.state.title = $event),
23855
- "data-test": "content-title",
23877
+ "data-testid": "content-title",
23856
23878
  disabled: _ctx.kyc,
23857
23879
  prepend: _ctx.lg.userAddress.titlePre,
23858
23880
  append: _ctx.lg.userAddress.titleApp,
@@ -23867,7 +23889,7 @@ function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) {
23867
23889
  id: "content-receiver",
23868
23890
  modelValue: _ctx.state.receiver,
23869
23891
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.state.receiver = $event),
23870
- "data-test": "content-receiver",
23892
+ "data-testid": "content-receiver",
23871
23893
  disabled: _ctx.kyc,
23872
23894
  prepend: _ctx.lg.userAddress.receiverPre,
23873
23895
  "prepend-class-name": _ctx.style.prepend,
@@ -23880,7 +23902,7 @@ function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) {
23880
23902
  id: "content-zip",
23881
23903
  modelValue: _ctx.state.zip,
23882
23904
  "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.state.zip = $event),
23883
- "data-test": "content-zip",
23905
+ "data-testid": "content-zip",
23884
23906
  disabled: _ctx.kyc,
23885
23907
  type: "zipCode",
23886
23908
  prepend: _ctx.lg.userAddress.inputPre,
@@ -23893,7 +23915,7 @@ function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) {
23893
23915
  key: 3,
23894
23916
  modelValue: _ctx.state.state,
23895
23917
  "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => _ctx.state.state = $event),
23896
- "data-test": "content-state",
23918
+ "data-testid": "content-state",
23897
23919
  disabled: _ctx.kyc,
23898
23920
  list: _ctx.states,
23899
23921
  class: normalizeClass([_ctx.style.input, _ctx.style.select]),
@@ -23905,7 +23927,7 @@ function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) {
23905
23927
  key: 4,
23906
23928
  modelValue: _ctx.state.city,
23907
23929
  "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => _ctx.state.city = $event),
23908
- "data-test": "content-city",
23930
+ "data-testid": "content-city",
23909
23931
  disabled: _ctx.kyc,
23910
23932
  prepend: _ctx.lg.userAddress.cityPre,
23911
23933
  "prepend-class-name": _ctx.style.prepend,
@@ -23918,7 +23940,7 @@ function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) {
23918
23940
  id: "content-street1",
23919
23941
  modelValue: _ctx.state.street1,
23920
23942
  "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => _ctx.state.street1 = $event),
23921
- "data-test": "content-street1",
23943
+ "data-testid": "content-street1",
23922
23944
  disabled: _ctx.kyc,
23923
23945
  prepend: _ctx.lg.userAddress.street1Pre,
23924
23946
  "prepend-class-name": _ctx.style.prepend,
@@ -23931,7 +23953,7 @@ function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) {
23931
23953
  id: "content-street2",
23932
23954
  modelValue: _ctx.state.street2,
23933
23955
  "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => _ctx.state.street2 = $event),
23934
- "data-test": "content-street2",
23956
+ "data-testid": "content-street2",
23935
23957
  disabled: _ctx.kyc,
23936
23958
  prepend: _ctx.lg.userAddress.street2Pre,
23937
23959
  "prepend-class-name": _ctx.style.prepend,
@@ -23942,7 +23964,7 @@ function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) {
23942
23964
  key: 7,
23943
23965
  modelValue: _ctx.state.tags,
23944
23966
  "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => _ctx.state.tags = $event),
23945
- "data-test": "content-tags",
23967
+ "data-testid": "content-tags",
23946
23968
  class: normalizeClass(_ctx.style.tag),
23947
23969
  disabled: _ctx.kyc
23948
23970
  }, null, 8, ["modelValue", "class", "disabled"])) : createCommentVNode("", true),
@@ -24223,7 +24245,8 @@ function _sfc_render$A(_ctx, _cache, $props, $setup, $data, $options) {
24223
24245
  type: "secondary",
24224
24246
  "forbidden-swipe": "",
24225
24247
  style: normalizeStyle(_ctx.heightStyles.rootHeight),
24226
- class: normalizeClass(_ctx.style.container)
24248
+ class: normalizeClass(_ctx.style.container),
24249
+ "data-testid": "add-address-sheet"
24227
24250
  }, {
24228
24251
  default: withCtx(() => [
24229
24252
  _ctx.isDesktop ? (openBlock(), createBlock(_component_DesktopHeader, {
@@ -24477,7 +24500,7 @@ function openWebview(params) {
24477
24500
  return;
24478
24501
  }
24479
24502
  try {
24480
- openUrl = new URL(appDetail == null ? void 0 : appDetail.openUrl);
24503
+ openUrl = appDetail ? new URL(appDetail.openUrl) : null;
24481
24504
  } catch (_) {
24482
24505
  }
24483
24506
  if (params == null ? void 0 : params.authorization) {
@@ -25992,13 +26015,14 @@ const _sfc_main$r = defineComponent({
25992
26015
  },
25993
26016
  emits: ["success"],
25994
26017
  setup(props, context) {
26018
+ var _a;
25995
26019
  const { isMobile, isDesktop } = useBreakpoints();
25996
26020
  const images2 = getImages();
25997
26021
  const { width: screenWidth } = window == null ? void 0 : window.screen;
25998
26022
  const timeout = screenWidth <= 767 ? 320 : 0;
25999
26023
  const showCashBackDetailRow = computed(() => {
26000
- var _a;
26001
- const cashBackDetailList = (_a = props.cashBackDetail) == null ? void 0 : _a.cashBackDetailList;
26024
+ var _a2;
26025
+ const cashBackDetailList = (_a2 = props.cashBackDetail) == null ? void 0 : _a2.cashBackDetailList;
26002
26026
  const calculating2 = props.calculating;
26003
26027
  const calculated = props.calculated;
26004
26028
  if (calculating2)
@@ -26066,7 +26090,7 @@ const _sfc_main$r = defineComponent({
26066
26090
  copyToClipboard({ value: paymentId2.value });
26067
26091
  };
26068
26092
  const style = useCssModule();
26069
- const storeImage2 = getAppDetail().appLogo || images2.merchant;
26093
+ const storeImage2 = ((_a = getAppDetail()) == null ? void 0 : _a.appLogo) || images2.merchant;
26070
26094
  const getDateStringFromTimeStamp = (timestamp) => {
26071
26095
  const date = new Date(timestamp * 1e3);
26072
26096
  return `${date.getFullYear()}\u5E74${date.getMonth() + 1}\u6708${date.getDate()}\u65E5 ${date.getHours()}\u6642${date.getMinutes()}\u5206${date.getSeconds()}\u79D2`;
@@ -26084,8 +26108,8 @@ const _sfc_main$r = defineComponent({
26084
26108
  merchantName: computed(() => props.paymentResult.merchantName),
26085
26109
  paymentId: paymentId2,
26086
26110
  price: computed(() => {
26087
- var _a, _b;
26088
- return numberWithCommas((_b = (_a = props.paymentResult) == null ? void 0 : _a.amount) == null ? void 0 : _b.amount);
26111
+ var _a2, _b;
26112
+ return numberWithCommas((_b = (_a2 = props.paymentResult) == null ? void 0 : _a2.amount) == null ? void 0 : _b.amount);
26089
26113
  }),
26090
26114
  statusLabelColor: computed(() => props.paymentResult.statusLabelColor.toLowerCase()),
26091
26115
  labelText: computed(() => props.paymentResult.statusLabelString),
@@ -27111,8 +27135,7 @@ const _sfc_main$k = defineComponent({
27111
27135
  props: {
27112
27136
  appDetail: {
27113
27137
  type: Object,
27114
- required: true,
27115
- default: () => ({})
27138
+ required: true
27116
27139
  },
27117
27140
  price: {
27118
27141
  type: Number,
@@ -27131,11 +27154,10 @@ const _sfc_main$k = defineComponent({
27131
27154
  }
27132
27155
  },
27133
27156
  setup(props) {
27134
- var _a;
27135
27157
  const style = useCssModule();
27136
27158
  const lg2 = getLanguage();
27137
27159
  const images2 = getImages();
27138
- const appLogo2 = ((_a = props.appDetail) == null ? void 0 : _a.appLogo) || images2.merchant;
27160
+ const appLogo2 = props.appDetail.appLogo || images2.merchant;
27139
27161
  const formatPrice = computed(() => numberWithCommas(props.price));
27140
27162
  const formatBalance = computed(() => numberWithCommas(props.balance));
27141
27163
  const formatInsufficientAmount = computed(() => numberWithCommas(props.insufficientAmount));
@@ -27930,6 +27952,7 @@ const _sfc_main$h = defineComponent({
27930
27952
  "layoutUpdate"
27931
27953
  ],
27932
27954
  setup(props, context) {
27955
+ var _a, _b;
27933
27956
  const { emit } = context;
27934
27957
  const topupPay2 = ref();
27935
27958
  const {
@@ -27961,7 +27984,11 @@ const _sfc_main$h = defineComponent({
27961
27984
  handleHeightChange();
27962
27985
  }, 500);
27963
27986
  });
27964
- const appDetail = getAppDetail();
27987
+ const savedAppDetail = getAppDetail();
27988
+ const appDetail = {
27989
+ appName: (_a = savedAppDetail == null ? void 0 : savedAppDetail.appName) != null ? _a : "",
27990
+ appLogo: (_b = savedAppDetail == null ? void 0 : savedAppDetail.appLogo) != null ? _b : null
27991
+ };
27965
27992
  const back2 = () => {
27966
27993
  removeMount();
27967
27994
  setTimeout(() => {
@@ -27969,11 +27996,11 @@ const _sfc_main$h = defineComponent({
27969
27996
  }, 600);
27970
27997
  };
27971
27998
  const amountLists = computed(() => {
27972
- var _a, _b, _c, _d, _e, _f;
27999
+ var _a2, _b2, _c, _d, _e, _f;
27973
28000
  const config = getAppConfig();
27974
28001
  return {
27975
- halfSheet: createHalfSheetAmount((_a = props.insufficientBalanceInfo) == null ? void 0 : _a.recommendedTopupAmount, (_c = (_b = config == null ? void 0 : config.topupHalfSheetAmount) == null ? void 0 : _b[0]) == null ? void 0 : _c.value),
27976
- buttons: createButtonsAmount((_d = props.insufficientBalanceInfo) == null ? void 0 : _d.recommendedTopupAmount, (_f = (_e = config == null ? void 0 : config.topupButtonsAmount) == null ? void 0 : _e[0]) == null ? void 0 : _f.value)
28002
+ halfSheet: createHalfSheetAmount((_a2 = props.insufficientBalanceInfo) == null ? void 0 : _a2.recommendedTopupAmount, (_c = (_b2 = config == null ? void 0 : config.topupHalfSheetAmount[0]) == null ? void 0 : _b2.value) != null ? _c : null),
28003
+ buttons: createButtonsAmount((_d = props.insufficientBalanceInfo) == null ? void 0 : _d.recommendedTopupAmount, (_f = (_e = config == null ? void 0 : config.topupButtonsAmount[0]) == null ? void 0 : _e.value) != null ? _f : null)
27977
28004
  };
27978
28005
  });
27979
28006
  const style = useCssModule();
@@ -28032,12 +28059,12 @@ const _sfc_main$h = defineComponent({
28032
28059
  };
28033
28060
  return {
28034
28061
  balance: computed(() => {
28035
- var _a, _b;
28036
- return (_b = (_a = props.insufficientBalanceInfo) == null ? void 0 : _a.totalBalanceInfo) == null ? void 0 : _b.balance;
28062
+ var _a2, _b2;
28063
+ return (_b2 = (_a2 = props.insufficientBalanceInfo) == null ? void 0 : _a2.totalBalanceInfo) == null ? void 0 : _b2.balance;
28037
28064
  }),
28038
28065
  insufficientAmount: computed(() => {
28039
- var _a;
28040
- return (_a = props.insufficientBalanceInfo) == null ? void 0 : _a.insufficientAmount;
28066
+ var _a2;
28067
+ return (_a2 = props.insufficientBalanceInfo) == null ? void 0 : _a2.insufficientAmount;
28041
28068
  }),
28042
28069
  back: back2,
28043
28070
  style,
@@ -28971,7 +28998,7 @@ const _sfc_main$g = defineComponent({
28971
28998
  updateAddressList
28972
28999
  } = useAddressControl();
28973
29000
  const {
28974
- getPaymentMethods: getPaymentMethods2,
29001
+ getPaymentMethods: getPaymentMethods3,
28975
29002
  selectPayment,
28976
29003
  paymentMethod: paymentMethod2,
28977
29004
  paymentMethods,
@@ -29012,7 +29039,7 @@ const _sfc_main$g = defineComponent({
29012
29039
  } = useCloseConfirmation();
29013
29040
  onMounted(async () => {
29014
29041
  startLoading();
29015
- const res = await Promise.all([getPaymentMethods2(true), getConsult2()]);
29042
+ const res = await Promise.all([getPaymentMethods3(true), getConsult2()]);
29016
29043
  const paymentMethodResult = res[0];
29017
29044
  const consultResult = res[1];
29018
29045
  if (consultResult === true && paymentMethodResult.result === false) {
@@ -29645,7 +29672,7 @@ const initErrorSheet = (initErrorSheet2) => {
29645
29672
  app.mount(container2);
29646
29673
  document.body.appendChild(container2);
29647
29674
  };
29648
- async function showErrorSheet(params) {
29675
+ function showErrorSheet(params) {
29649
29676
  var _a;
29650
29677
  reconstructParams(params);
29651
29678
  try {
@@ -29794,7 +29821,7 @@ const initAlertSheet = (initAlertSheet2) => {
29794
29821
  app.mount(container2);
29795
29822
  document.body.appendChild(container2);
29796
29823
  };
29797
- async function showAlert(params) {
29824
+ function showAlert(params) {
29798
29825
  var _a;
29799
29826
  reconstructParams(params);
29800
29827
  try {
@@ -29894,6 +29921,80 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
29894
29921
  const cssModules$6 = {};
29895
29922
  cssModules$6["$style"] = style0$6;
29896
29923
  var BannerInfo = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$d], ["__cssModules", cssModules$6]]);
29924
+ const cashbackInfoContainer = "_cashbackInfoContainer_18hoj_1";
29925
+ const balanceTitle = "_balanceTitle_18hoj_4";
29926
+ const transferTitle = "_transferTitle_18hoj_12";
29927
+ const flexContainer = "_flexContainer_18hoj_18";
29928
+ var style0$5 = {
29929
+ cashbackInfoContainer,
29930
+ balanceTitle,
29931
+ transferTitle,
29932
+ flexContainer
29933
+ };
29934
+ const _sfc_main$c = defineComponent({
29935
+ components: {},
29936
+ props: {
29937
+ cashbackInfo: {
29938
+ type: Object,
29939
+ default: () => {
29940
+ },
29941
+ required: true
29942
+ },
29943
+ totalBalanceInfo: {
29944
+ type: String,
29945
+ default: () => {
29946
+ },
29947
+ required: true
29948
+ },
29949
+ allTotalBalanceInfo: {
29950
+ type: String,
29951
+ default: () => {
29952
+ },
29953
+ required: true
29954
+ },
29955
+ isCharging: {
29956
+ type: Boolean,
29957
+ default: false,
29958
+ required: true
29959
+ }
29960
+ },
29961
+ emits: ["click"],
29962
+ setup(props) {
29963
+ const lg2 = getLanguage();
29964
+ const style = useCssModule();
29965
+ return {
29966
+ availableBalText: computed(() => props.isCharging ? lg2.topup.availableBalanceAfter : lg2.topup.availableBalance),
29967
+ isCashbackSave: computed(() => {
29968
+ var _a;
29969
+ return ((_a = props == null ? void 0 : props.cashbackInfo) == null ? void 0 : _a.cashBackUseStatus) === "SAVE";
29970
+ }),
29971
+ style,
29972
+ lg: lg2
29973
+ };
29974
+ }
29975
+ });
29976
+ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
29977
+ return openBlock(), createElementBlock("div", {
29978
+ class: normalizeClass(_ctx.style.cashbackInfoContainer)
29979
+ }, [
29980
+ createBaseVNode("div", {
29981
+ class: normalizeClass([_ctx.style.flexContainer, _ctx.style.balanceTitle])
29982
+ }, [
29983
+ createBaseVNode("span", null, toDisplayString(_ctx.availableBalText), 1),
29984
+ createBaseVNode("span", null, toDisplayString(_ctx.totalBalanceInfo) + " \u5186 ", 1)
29985
+ ], 2),
29986
+ _ctx.isCashbackSave ? (openBlock(), createElementBlock("div", {
29987
+ key: 0,
29988
+ class: normalizeClass([_ctx.style.flexContainer, _ctx.style.transferTitle])
29989
+ }, [
29990
+ createBaseVNode("span", null, toDisplayString(_ctx.lg.topup.allBalance), 1),
29991
+ createBaseVNode("span", null, toDisplayString(_ctx.allTotalBalanceInfo) + " \u5186 ", 1)
29992
+ ], 2)) : createCommentVNode("", true)
29993
+ ], 2);
29994
+ }
29995
+ const cssModules$5 = {};
29996
+ cssModules$5["$style"] = style0$5;
29997
+ var CashbackInfo = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$c], ["__cssModules", cssModules$5]]);
29897
29998
  const completion = "_completion_9o00a_1";
29898
29999
  const title$2 = "_title_9o00a_5";
29899
30000
  const paypayLogo = "_paypayLogo_9o00a_10";
@@ -29908,7 +30009,7 @@ const green = "_green_9o00a_51";
29908
30009
  const red = "_red_9o00a_54";
29909
30010
  const yellow = "_yellow_9o00a_57";
29910
30011
  const gray = "_gray_9o00a_60";
29911
- var style0$5 = {
30012
+ var style0$4 = {
29912
30013
  completion,
29913
30014
  title: title$2,
29914
30015
  paypayLogo,
@@ -29924,7 +30025,7 @@ var style0$5 = {
29924
30025
  yellow,
29925
30026
  gray
29926
30027
  };
29927
- const _sfc_main$c = defineComponent({
30028
+ const _sfc_main$b = defineComponent({
29928
30029
  components: {
29929
30030
  Button,
29930
30031
  Divider
@@ -29981,7 +30082,7 @@ const _hoisted_1$a = ["src"];
29981
30082
  const _hoisted_2$7 = /* @__PURE__ */ createTextVNode(" \u5186 ");
29982
30083
  const _hoisted_3$6 = ["src"];
29983
30084
  const _hoisted_4$5 = /* @__PURE__ */ createTextVNode(" \u9589\u3058\u308B ");
29984
- function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
30085
+ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
29985
30086
  const _component_Divider = resolveComponent("Divider");
29986
30087
  const _component_Button = resolveComponent("Button");
29987
30088
  return openBlock(), createElementBlock("div", {
@@ -30047,83 +30148,9 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
30047
30148
  })
30048
30149
  ], 2);
30049
30150
  }
30050
- const cssModules$5 = {};
30051
- cssModules$5["$style"] = style0$5;
30052
- var TopupCompletion = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$c], ["__cssModules", cssModules$5]]);
30053
- const cashbackInfoContainer = "_cashbackInfoContainer_18hoj_1";
30054
- const balanceTitle = "_balanceTitle_18hoj_4";
30055
- const transferTitle = "_transferTitle_18hoj_12";
30056
- const flexContainer = "_flexContainer_18hoj_18";
30057
- var style0$4 = {
30058
- cashbackInfoContainer,
30059
- balanceTitle,
30060
- transferTitle,
30061
- flexContainer
30062
- };
30063
- const _sfc_main$b = defineComponent({
30064
- components: {},
30065
- props: {
30066
- cashbackInfo: {
30067
- type: Object,
30068
- default: () => {
30069
- },
30070
- required: true
30071
- },
30072
- totalBalanceInfo: {
30073
- type: String,
30074
- default: () => {
30075
- },
30076
- required: true
30077
- },
30078
- allTotalBalanceInfo: {
30079
- type: String,
30080
- default: () => {
30081
- },
30082
- required: true
30083
- },
30084
- isCharging: {
30085
- type: Boolean,
30086
- default: false,
30087
- required: true
30088
- }
30089
- },
30090
- emits: ["click"],
30091
- setup(props) {
30092
- const lg2 = getLanguage();
30093
- const style = useCssModule();
30094
- return {
30095
- availableBalText: computed(() => props.isCharging ? lg2.topup.availableBalanceAfter : lg2.topup.availableBalance),
30096
- isCashbackSave: computed(() => {
30097
- var _a;
30098
- return ((_a = props == null ? void 0 : props.cashbackInfo) == null ? void 0 : _a.cashBackUseStatus) === "SAVE";
30099
- }),
30100
- style,
30101
- lg: lg2
30102
- };
30103
- }
30104
- });
30105
- function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
30106
- return openBlock(), createElementBlock("div", {
30107
- class: normalizeClass(_ctx.style.cashbackInfoContainer)
30108
- }, [
30109
- createBaseVNode("div", {
30110
- class: normalizeClass([_ctx.style.flexContainer, _ctx.style.balanceTitle])
30111
- }, [
30112
- createBaseVNode("span", null, toDisplayString(_ctx.availableBalText), 1),
30113
- createBaseVNode("span", null, toDisplayString(_ctx.totalBalanceInfo) + " \u5186 ", 1)
30114
- ], 2),
30115
- _ctx.isCashbackSave ? (openBlock(), createElementBlock("div", {
30116
- key: 0,
30117
- class: normalizeClass([_ctx.style.flexContainer, _ctx.style.transferTitle])
30118
- }, [
30119
- createBaseVNode("span", null, toDisplayString(_ctx.lg.topup.allBalance), 1),
30120
- createBaseVNode("span", null, toDisplayString(_ctx.allTotalBalanceInfo) + " \u5186 ", 1)
30121
- ], 2)) : createCommentVNode("", true)
30122
- ], 2);
30123
- }
30124
30151
  const cssModules$4 = {};
30125
30152
  cssModules$4["$style"] = style0$4;
30126
- var CashbackInfo = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$b], ["__cssModules", cssModules$4]]);
30153
+ var TopupCompletion = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$b], ["__cssModules", cssModules$4]]);
30127
30154
  const topupWrapper = "_topupWrapper_19kvr_7";
30128
30155
  const fullHeight = "_fullHeight_19kvr_13";
30129
30156
  const bannerText = "_bannerText_19kvr_20";
@@ -30308,7 +30335,7 @@ const _sfc_main$a = defineComponent({
30308
30335
  methods: {
30309
30336
  numberWithCommas,
30310
30337
  async init() {
30311
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
30338
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
30312
30339
  this.loading = true;
30313
30340
  this.isFirstLoad = true;
30314
30341
  const paymentIDParams = __spreadProps(__spreadValues({}, ((_a = this.topupParams) == null ? void 0 : _a.merchant) && {
@@ -30320,23 +30347,30 @@ const _sfc_main$a = defineComponent({
30320
30347
  sourceInfoApp: (_d = this.topupParams) == null ? void 0 : _d.sourceInfoApp,
30321
30348
  productType: (_e = this.topupParams) == null ? void 0 : _e.productType
30322
30349
  });
30323
- const paymentIdResponse = await getPaymentMethods(paymentIDParams);
30324
- if (!paymentIdResponse || "error" in paymentIdResponse) {
30325
- this.errorCode = paymentIdResponse.error.message === MiniAppErrorType.timeOut ? MiniAppErrorType.timeOut : MiniAppErrorType.serverError;
30326
- this.errorShow = true;
30327
- return;
30328
- } else if (((_g = (_f = paymentIdResponse == null ? void 0 : paymentIdResponse.unsigned) == null ? void 0 : _f.resultInfo) == null ? void 0 : _g.code) !== "SUCCESS") {
30329
- this.errorCode = MiniAppErrorType.serverError;
30330
- this.showError();
30331
- return;
30350
+ const paymentIdResponse = await getPaymentMethods2(paymentIDParams);
30351
+ switch (paymentIdResponse.ppFetchResult) {
30352
+ case "success":
30353
+ break;
30354
+ case "timeout":
30355
+ this.errorCode = MiniAppErrorType.timeOut;
30356
+ this.errorShow = true;
30357
+ return;
30358
+ case "apiError":
30359
+ this.errorCode = MiniAppErrorType.serverError;
30360
+ this.showError();
30361
+ return;
30362
+ default:
30363
+ this.errorCode = MiniAppErrorType.serverError;
30364
+ this.errorShow = true;
30365
+ return;
30332
30366
  }
30333
- this.paymentMethodList = filterUnsupportedPaymentMethod((_j = (_i = (_h = paymentIdResponse == null ? void 0 : paymentIdResponse.unsigned) == null ? void 0 : _h.data) == null ? void 0 : _i.payload) == null ? void 0 : _j.paymentMethodList);
30367
+ this.paymentMethodList = filterUnsupportedPaymentMethod((_h = (_g = (_f = paymentIdResponse.body.unsigned) == null ? void 0 : _f.data) == null ? void 0 : _g.payload) == null ? void 0 : _h.paymentMethodList);
30334
30368
  this.findFirstValidMethod(0);
30335
30369
  const config = getAppConfig();
30336
30370
  if (config) {
30337
- this.inputMoney = (_k = config == null ? void 0 : config.topupHalfSheetRecommendedAmount[0]) == null ? void 0 : _k.value;
30338
- this.topupHalfSheetAmount = (_l = config == null ? void 0 : config.topupHalfSheetAmount[0]) == null ? void 0 : _l.value;
30339
- this.topupButtonsAmount = (_m = config == null ? void 0 : config.topupButtonsAmount[0]) == null ? void 0 : _m.value;
30371
+ this.inputMoney = (_i = config == null ? void 0 : config.topupHalfSheetRecommendedAmount[0]) == null ? void 0 : _i.value;
30372
+ this.topupHalfSheetAmount = (_j = config == null ? void 0 : config.topupHalfSheetAmount[0]) == null ? void 0 : _j.value;
30373
+ this.topupButtonsAmount = (_k = config == null ? void 0 : config.topupButtonsAmount[0]) == null ? void 0 : _k.value;
30340
30374
  }
30341
30375
  this.loading = false;
30342
30376
  this.isFirstLoad = false;
@@ -31081,11 +31115,11 @@ const initShowUpdateWarning = (params) => {
31081
31115
  app.mount(container2);
31082
31116
  document.body.appendChild(container2);
31083
31117
  };
31084
- async function showUpdateWarning$1(params) {
31118
+ function showUpdateWarning$1(params) {
31085
31119
  reconstructParams(params);
31086
31120
  initShowUpdateWarning(params);
31087
31121
  }
31088
- async function scanCode(params) {
31122
+ function scanCode(params) {
31089
31123
  reconstructParams(params);
31090
31124
  if (isPayPayMiniApp()) {
31091
31125
  closeApp({
@@ -31289,7 +31323,7 @@ async function takePhoto$1(params) {
31289
31323
  takePhotoInternal(params, TakePhotoMode.album);
31290
31324
  }
31291
31325
  }
31292
- async function setTitle(params) {
31326
+ function setTitle(params) {
31293
31327
  var _a;
31294
31328
  reconstructParams(params);
31295
31329
  document.title = (params == null ? void 0 : params.title) || "";
@@ -32008,7 +32042,7 @@ function debug(params) {
32008
32042
  function execute$5(params) {
32009
32043
  var _a;
32010
32044
  (_a = params == null ? void 0 : params.success) == null ? void 0 : _a.call(params, {
32011
- v: "1.25.0"
32045
+ v: "1.26.0"
32012
32046
  });
32013
32047
  }
32014
32048
  function useCallBack(props, ctx) {
@@ -32918,20 +32952,25 @@ function registerEmail(params) {
32918
32952
  initRegisterEmail(params).catch(() => {
32919
32953
  });
32920
32954
  }
32921
- async function registerKyc(params) {
32955
+ function registerKyc(params) {
32922
32956
  reconstructParams(params);
32923
- await execute$4(params);
32957
+ execute$4(params);
32924
32958
  }
32925
- async function execute$4(params) {
32959
+ function execute$4(params) {
32960
+ var _a;
32926
32961
  params = __spreadProps(__spreadValues({}, params), {
32927
32962
  type: (params == null ? void 0 : params.type) || "EKYC"
32928
32963
  });
32929
32964
  const appDetail = getAppDetail();
32930
32965
  const clientId = getClientId();
32966
+ if (!clientId) {
32967
+ (_a = params.fail) == null ? void 0 : _a.call(params, { errorCode: MiniAppErrorType.sdkNotInitialized });
32968
+ return;
32969
+ }
32931
32970
  let deeplink = `paypay://kyc/top?appId=${clientId}&appName=${encodeURIComponent((appDetail == null ? void 0 : appDetail.appName) || "")}`;
32932
32971
  Object.entries(params).map(([key, value2]) => {
32933
32972
  if (typeof value2 !== "function") {
32934
- let kycData = encodeURIComponent(value2);
32973
+ let kycData = encodeURIComponent(String(value2));
32935
32974
  if (Array.isArray(value2)) {
32936
32975
  kycData = value2.join(",");
32937
32976
  } else if (typeof value2 === "object") {
@@ -32962,7 +33001,7 @@ function validType(params) {
32962
33001
  return authTypes.includes(params == null ? void 0 : params.type);
32963
33002
  }
32964
33003
  async function execute$3(params) {
32965
- var _a, _b, _c, _d, _e;
33004
+ var _a, _b, _c;
32966
33005
  if (!validType(params)) {
32967
33006
  return (_a = params == null ? void 0 : params.fail) == null ? void 0 : _a.call(params, { errorCode: MiniAppErrorType.invalidType });
32968
33007
  }
@@ -32974,7 +33013,7 @@ async function execute$3(params) {
32974
33013
  if (!res || "error" in res) {
32975
33014
  return (_b = params == null ? void 0 : params.fail) == null ? void 0 : _b.call(params, { errorCode: MiniAppErrorType.serverError });
32976
33015
  }
32977
- if ((_d = (_c = res == null ? void 0 : res.unsigned) == null ? void 0 : _c.data) == null ? void 0 : _d.sessionId) {
33016
+ if (res.unsigned.data.sessionId) {
32978
33017
  const sessionId = res.unsigned.data.sessionId;
32979
33018
  const deeplink = `paypay://miniAppMFA?ppSessionId=${sessionId}&type=${params.type}&callbackUrl=${params == null ? void 0 : params.callbackUrl}`;
32980
33019
  closeApp({
@@ -32986,7 +33025,7 @@ async function execute$3(params) {
32986
33025
  throw new Error();
32987
33026
  }
32988
33027
  } catch {
32989
- return (_e = params == null ? void 0 : params.fail) == null ? void 0 : _e.call(params, { errorCode: MiniAppErrorType.serverError });
33028
+ return (_c = params == null ? void 0 : params.fail) == null ? void 0 : _c.call(params, { errorCode: MiniAppErrorType.serverError });
32990
33029
  }
32991
33030
  }
32992
33031
  function logout(params) {
@@ -33235,7 +33274,7 @@ const initSmartButton = (params, data2, preferredLanguage, isLoggedIn) => {
33235
33274
  const container2 = document.getElementById(params == null ? void 0 : params.containerId);
33236
33275
  container2 && app.mount(container2);
33237
33276
  };
33238
- async function renderLoginButton(params, lg2, preferredLanguage, loggedinUser) {
33277
+ function renderLoginButton(params, lg2, preferredLanguage, loggedinUser) {
33239
33278
  var _a, _b;
33240
33279
  if (!(params == null ? void 0 : params.containerId) || !document.getElementById(params == null ? void 0 : params.containerId)) {
33241
33280
  (_a = params == null ? void 0 : params.fail) == null ? void 0 : _a.call(params);
@@ -33260,7 +33299,7 @@ async function renderLoginButton(params, lg2, preferredLanguage, loggedinUser) {
33260
33299
  }
33261
33300
  initSmartButton(params, data2, preferredLanguage);
33262
33301
  }
33263
- async function renderPayButton(params, lg2, preferredLanguage, isLoggedIn, cashbackInfo) {
33302
+ function renderPayButton(params, lg2, preferredLanguage, isLoggedIn, cashbackInfo) {
33264
33303
  var _a;
33265
33304
  if (!(params == null ? void 0 : params.containerId) || !document.getElementById(params == null ? void 0 : params.containerId)) {
33266
33305
  (_a = params == null ? void 0 : params.fail) == null ? void 0 : _a.call(params);
@@ -33552,7 +33591,7 @@ var en$1 = /* @__PURE__ */ Object.freeze({
33552
33591
  closeConfirmation,
33553
33592
  "default": en
33554
33593
  });
33555
- async function render(params) {
33594
+ function render(params) {
33556
33595
  reconstructParams(params);
33557
33596
  let preferredLanguage = (params == null ? void 0 : params.locale) || getPayPayLanguage();
33558
33597
  const { smartLogin: smartLogin2, smartPay: smartPay2 } = preferredLanguage === "en" ? en$1 : ja$1;
@@ -33566,11 +33605,14 @@ async function render(params) {
33566
33605
  success: () => {
33567
33606
  renderPay(__spreadProps(__spreadValues({}, params), {
33568
33607
  url: void 0
33569
- }), smartPay2, preferredLanguage, true);
33608
+ }), smartPay2, preferredLanguage, true).catch(() => {
33609
+ });
33570
33610
  },
33571
33611
  fail: () => {
33572
- renderPay(params, smartPay2, preferredLanguage, false);
33612
+ renderPay(params, smartPay2, preferredLanguage, false).catch(() => {
33613
+ });
33573
33614
  }
33615
+ }).catch(() => {
33574
33616
  });
33575
33617
  }
33576
33618
  }
@@ -33624,10 +33666,10 @@ function callbackHandler(params, callback) {
33624
33666
  (_a = params == null ? void 0 : params.fail) == null ? void 0 : _a.call(params);
33625
33667
  }
33626
33668
  }
33627
- async function setSessionData(params) {
33669
+ function setSessionData(params) {
33628
33670
  var _a, _b;
33629
33671
  reconstructParams(params);
33630
- await sessionStorage.setItem(params == null ? void 0 : params.key, (_a = params == null ? void 0 : params.value) != null ? _a : "");
33672
+ sessionStorage.setItem(params == null ? void 0 : params.key, (_a = params == null ? void 0 : params.value) != null ? _a : "");
33631
33673
  (_b = params == null ? void 0 : params.success) == null ? void 0 : _b.call(params);
33632
33674
  }
33633
33675
  function getSessionData(params) {
@@ -33636,10 +33678,10 @@ function getSessionData(params) {
33636
33678
  const value2 = sessionStorage.getItem(params == null ? void 0 : params.key);
33637
33679
  (_a = params == null ? void 0 : params.success) == null ? void 0 : _a.call(params, { [params == null ? void 0 : params.key]: value2 != null ? value2 : "" });
33638
33680
  }
33639
- async function setStorageData(params) {
33681
+ function setStorageData(params) {
33640
33682
  var _a, _b;
33641
33683
  reconstructParams(params);
33642
- await localStorage.setItem(params == null ? void 0 : params.key, (_a = params == null ? void 0 : params.value) != null ? _a : "");
33684
+ localStorage.setItem(params == null ? void 0 : params.key, (_a = params == null ? void 0 : params.value) != null ? _a : "");
33643
33685
  (_b = params == null ? void 0 : params.success) == null ? void 0 : _b.call(params);
33644
33686
  }
33645
33687
  function getStorageData(params) {
@@ -33648,20 +33690,20 @@ function getStorageData(params) {
33648
33690
  const value2 = localStorage.getItem(params == null ? void 0 : params.key);
33649
33691
  (_a = params == null ? void 0 : params.success) == null ? void 0 : _a.call(params, { [params == null ? void 0 : params.key]: value2 != null ? value2 : "" });
33650
33692
  }
33651
- async function removeStorageData(params) {
33693
+ function removeStorageData(params) {
33652
33694
  var _a;
33653
33695
  reconstructParams(params);
33654
- await localStorage.removeItem(params == null ? void 0 : params.key);
33696
+ localStorage.removeItem(params == null ? void 0 : params.key);
33655
33697
  (_a = params == null ? void 0 : params.success) == null ? void 0 : _a.call(params);
33656
33698
  }
33657
33699
  const errorCodes = new Map();
33658
- errorCodes.set(414, "INVALID_URL");
33659
- errorCodes.set(413, "INVALID_DATA");
33660
- errorCodes.set(400, "INVALID_HEADER");
33661
- errorCodes.set(405, "INVALID_METHOD");
33662
- errorCodes.set(502, "INVALID_RESPONSE");
33700
+ errorCodes.set(414, MiniAppErrorType.invalidUrl);
33701
+ errorCodes.set(413, MiniAppErrorType.invalidData);
33702
+ errorCodes.set(400, MiniAppErrorType.invalidHeader);
33703
+ errorCodes.set(405, MiniAppErrorType.invalidMethod);
33704
+ errorCodes.set(502, MiniAppErrorType.invalidResponse);
33663
33705
  async function request(params) {
33664
- var _a, _b, _c, _d, _e;
33706
+ var _a, _b, _c, _d;
33665
33707
  reconstructParams(params);
33666
33708
  try {
33667
33709
  const response = await fetch(params == null ? void 0 : params.url, {
@@ -33679,8 +33721,10 @@ async function request(params) {
33679
33721
  if (!_error.response) {
33680
33722
  return (_b = params == null ? void 0 : params.fail) == null ? void 0 : _b.call(params, { errorCode: MiniAppErrorType.invalidResponse });
33681
33723
  } else {
33682
- const errorMsg = errorCodes.has((_c = _error.response) == null ? void 0 : _c.status) ? errorCodes.get((_d = _error.response) == null ? void 0 : _d.status) : MiniAppErrorType.statusCodeError;
33683
- return (_e = params == null ? void 0 : params.fail) == null ? void 0 : _e.call(params, { errorCode: errorMsg });
33724
+ const errorMsg = _error.response ? errorCodes.get((_c = _error.response) == null ? void 0 : _c.status) : null;
33725
+ return (_d = params == null ? void 0 : params.fail) == null ? void 0 : _d.call(params, {
33726
+ errorCode: errorMsg != null ? errorMsg : MiniAppErrorType.statusCodeError
33727
+ });
33684
33728
  }
33685
33729
  }
33686
33730
  }
@@ -33719,7 +33763,8 @@ class MiniAppModule extends JsBridgeModule {
33719
33763
  return getRuntime() === MiniAppRuntime.android ? RuntimeEnv.Native : RuntimeEnv.JS;
33720
33764
  }
33721
33765
  init(params) {
33722
- init(params);
33766
+ init(params).catch(() => {
33767
+ });
33723
33768
  }
33724
33769
  copyToClipboard(params) {
33725
33770
  copyToClipboard(params);
@@ -33740,32 +33785,39 @@ class MiniAppModule extends JsBridgeModule {
33740
33785
  closeApp(params);
33741
33786
  }
33742
33787
  request(params) {
33743
- request(params);
33788
+ request(params).catch(() => {
33789
+ });
33744
33790
  }
33745
33791
  requestInternal(params) {
33746
- requestInternal(params);
33792
+ requestInternal(params).catch(() => {
33793
+ });
33747
33794
  }
33748
33795
  getUAID(params) {
33749
33796
  getUAID(params);
33750
33797
  }
33751
33798
  getBalance(params) {
33752
- getBalance(params);
33799
+ getBalance(params).catch(() => {
33800
+ });
33753
33801
  }
33754
33802
  getAuthStatus(params) {
33755
- getAuthStatus(params);
33803
+ getAuthStatus(params).catch(() => {
33804
+ });
33756
33805
  }
33757
33806
  makePayment(params) {
33758
33807
  if (!this.isExecutableService(params))
33759
33808
  return;
33760
- makePayment(params);
33809
+ makePayment(params).catch(() => {
33810
+ });
33761
33811
  }
33762
33812
  createOrder(params) {
33763
33813
  if (!this.isExecutableService(params))
33764
33814
  return;
33765
- makePayment(params);
33815
+ makePayment(params).catch(() => {
33816
+ });
33766
33817
  }
33767
33818
  getUserProfile(params) {
33768
- getUserProfile(params);
33819
+ getUserProfile(params).catch(() => {
33820
+ });
33769
33821
  }
33770
33822
  topup(params) {
33771
33823
  if (!this.isExecutableService(params))
@@ -33788,7 +33840,8 @@ class MiniAppModule extends JsBridgeModule {
33788
33840
  removeStorageData(params);
33789
33841
  }
33790
33842
  getPermissionStatus(params) {
33791
- getPermissionStatus(params);
33843
+ getPermissionStatus(params).catch(() => {
33844
+ });
33792
33845
  }
33793
33846
  scanCode(params) {
33794
33847
  scanCode(params);
@@ -33809,7 +33862,8 @@ class MiniAppModule extends JsBridgeModule {
33809
33862
  this.detectMode() === RuntimeEnv.JS ? showUpdateWarning$1(params) : this.jsBridge.callNative("showUpdateWarning", params);
33810
33863
  }
33811
33864
  getPlatformInformation(params) {
33812
- getPlatformInformation(params);
33865
+ getPlatformInformation(params).catch(() => {
33866
+ });
33813
33867
  }
33814
33868
  getDeviceInformation(params) {
33815
33869
  getDeviceInformation(params);
@@ -33818,10 +33872,12 @@ class MiniAppModule extends JsBridgeModule {
33818
33872
  this.detectMode() === RuntimeEnv.JS ? openApp$1(params) : this.jsBridge.callNative("openApp", params);
33819
33873
  }
33820
33874
  share(params) {
33821
- this.detectMode() === RuntimeEnv.JS ? share(params) : this.jsBridge.callNative("share", params);
33875
+ this.detectMode() === RuntimeEnv.JS ? share(params).catch(() => {
33876
+ }) : this.jsBridge.callNative("share", params);
33822
33877
  }
33823
33878
  getKycInformation(params) {
33824
- getKycInformation(params);
33879
+ getKycInformation(params).catch(() => {
33880
+ });
33825
33881
  }
33826
33882
  getUserAddress(params) {
33827
33883
  getUserAddress(params);
@@ -33832,13 +33888,16 @@ class MiniAppModule extends JsBridgeModule {
33832
33888
  inputAddress(params);
33833
33889
  }
33834
33890
  getUserLocation(params) {
33835
- getUserLocation(params != null ? params : {});
33891
+ getUserLocation(params != null ? params : {}).catch(() => {
33892
+ });
33836
33893
  }
33837
33894
  takePhoto(params) {
33838
- takePhoto$1(params != null ? params : {});
33895
+ takePhoto$1(params != null ? params : {}).catch(() => {
33896
+ });
33839
33897
  }
33840
33898
  checkPaymentMethod(params) {
33841
- checkPaymentMethod(params);
33899
+ checkPaymentMethod(params).catch(() => {
33900
+ });
33842
33901
  }
33843
33902
  debug(params) {
33844
33903
  debug(params);
@@ -33858,13 +33917,15 @@ class MiniAppModule extends JsBridgeModule {
33858
33917
  registerKyc(params);
33859
33918
  }
33860
33919
  startMultiFactorAuth(params) {
33861
- startMultiFactorAuth(params);
33920
+ startMultiFactorAuth(params).catch(() => {
33921
+ });
33862
33922
  }
33863
33923
  logout(params) {
33864
33924
  logout(params);
33865
33925
  }
33866
33926
  verifyMultiFactorAuthResult(params) {
33867
- verifyMultiFactorAuthResult(params);
33927
+ verifyMultiFactorAuthResult(params).catch(() => {
33928
+ });
33868
33929
  }
33869
33930
  render(params) {
33870
33931
  render(params);