@paypay/mini-app-js-sdk 1.49.0 → 1.51.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.
@@ -85,8 +85,8 @@ function normalizeNativeResponseData(data2) {
85
85
  }
86
86
  class JsBridge {
87
87
  constructor(global2) {
88
- this.version = "1.49.0";
89
- this.revision = "3c10381";
88
+ this.version = "1.51.0";
89
+ this.revision = "8d484fc";
90
90
  this.messageHandlers = new Map();
91
91
  this.responseCallbacks = new Map();
92
92
  this.global = global2;
@@ -214,6 +214,7 @@ var MiniAppErrorType;
214
214
  MiniAppErrorType2["deeplinkUnavailable"] = "DEEPLINK_UNAVAILABLE";
215
215
  MiniAppErrorType2["kycIncompleted"] = "KYC_INCOMPLETED";
216
216
  MiniAppErrorType2["noBankAccount"] = "NO_BANK_ACCOUNT";
217
+ MiniAppErrorType2["invalidPaymentIdentifier"] = "INVALID_PAYMENT_IDENTIFIER";
217
218
  })(MiniAppErrorType || (MiniAppErrorType = {}));
218
219
  class PayPayJsBridgeBase {
219
220
  constructor(jsBridge2) {
@@ -1634,7 +1635,10 @@ function openWebview(openWebviewParams) {
1634
1635
  } catch (_) {
1635
1636
  }
1636
1637
  if (params == null ? void 0 : params.authorization) {
1637
- params.url = getAuthUrl(params.url);
1638
+ const url2 = getAuthUrl(params);
1639
+ if (url2 === null)
1640
+ return;
1641
+ params.url = url2;
1638
1642
  openWebviewInternal(params);
1639
1643
  } else if (["http:", "https:"].includes(url.protocol) && ((params == null ? void 0 : params.style) === "external" || ((_b = appDetail == null ? void 0 : appDetail.whiteListDomains) == null ? void 0 : _b.includes(url.host)) || url.host === (openUrl2 == null ? void 0 : openUrl2.host))) {
1640
1644
  openWebviewInternal(params);
@@ -1665,8 +1669,8 @@ function openWebviewInternal(params) {
1665
1669
  }
1666
1670
  }
1667
1671
  }
1668
- function getAuthUrl(redirectUrl) {
1669
- var _a;
1672
+ function getAuthUrl(params) {
1673
+ var _a, _b;
1670
1674
  let authUrl = "";
1671
1675
  switch (getEnv()) {
1672
1676
  case "staging":
@@ -1686,7 +1690,13 @@ function getAuthUrl(redirectUrl) {
1686
1690
  authUrl = "https://www.paypay.ne.jp";
1687
1691
  }
1688
1692
  const clientId = (_a = getClientId()) != null ? _a : "";
1689
- return `${authUrl}/portal/auth/mini-app/permission?clientId=${clientId}&redirectUrl=${encodeURIComponent(redirectUrl)}`;
1693
+ if (!clientId) {
1694
+ (_b = params == null ? void 0 : params.fail) == null ? void 0 : _b.call(params, {
1695
+ errorCode: MiniAppErrorType.sdkNotInitialized
1696
+ });
1697
+ return null;
1698
+ }
1699
+ return `${authUrl}/portal/auth/mini-app/permission?clientId=${clientId}&redirectUrl=${encodeURIComponent(params.url)}`;
1690
1700
  }
1691
1701
  function isDef(val2) {
1692
1702
  return val2 !== void 0 && val2 !== null;
@@ -1956,7 +1966,7 @@ const opaUrl = () => {
1956
1966
  const createHeaderMiniAppApi = (urlEndpoint, customHeaders) => {
1957
1967
  let headers = new Headers(__spreadValues({
1958
1968
  "Content-Type": "application/json",
1959
- "Client-Version": "1.49.0",
1969
+ "Client-Version": "1.51.0",
1960
1970
  "Client-OS-Type": getRuntime()
1961
1971
  }, customHeaders));
1962
1972
  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" || urlEndpoint === "web-api/app/v1/users/autoTopupConfiguration" || urlEndpoint === "web-api/app/v1/users/preTransactionAutoTopupConfiguration") {
@@ -2149,10 +2159,10 @@ var MiniAppStatusType;
2149
2159
  })(MiniAppStatusType || (MiniAppStatusType = {}));
2150
2160
  function getUAID(params) {
2151
2161
  const newParams = reconstructParams(params);
2152
- execute$f(newParams).catch(() => {
2162
+ execute$g(newParams).catch(() => {
2153
2163
  });
2154
2164
  }
2155
- async function execute$f(params) {
2165
+ async function execute$g(params) {
2156
2166
  var _a, _b, _c, _d, _e;
2157
2167
  const res = await ppFetch2({
2158
2168
  method: "GET",
@@ -2166,9 +2176,9 @@ async function execute$f(params) {
2166
2176
  }
2167
2177
  function checkAccessToken(params) {
2168
2178
  const newParams = reconstructParams(params);
2169
- execute$e(newParams);
2179
+ execute$f(newParams);
2170
2180
  }
2171
- function execute$e(params) {
2181
+ function execute$f(params) {
2172
2182
  var _a, _b;
2173
2183
  const clientId = getClientId();
2174
2184
  const token = getAccessToken();
@@ -2193,9 +2203,9 @@ function execute$e(params) {
2193
2203
  }
2194
2204
  async function getUserProfile(params) {
2195
2205
  const newParams = reconstructParams(params);
2196
- await execute$d(newParams);
2206
+ await execute$e(newParams);
2197
2207
  }
2198
- async function execute$d(params) {
2208
+ async function execute$e(params) {
2199
2209
  var _a, _b;
2200
2210
  const res = await ppFetch2({
2201
2211
  method: "GET",
@@ -2772,7 +2782,7 @@ function createGetter(isReadonly2 = false, shallow = false) {
2772
2782
  return res;
2773
2783
  };
2774
2784
  }
2775
- const set$1 = /* @__PURE__ */ createSetter();
2785
+ const set = /* @__PURE__ */ createSetter();
2776
2786
  const shallowSet = /* @__PURE__ */ createSetter(true);
2777
2787
  function createSetter(shallow = false) {
2778
2788
  return function set2(target, key2, value2, receiver2) {
@@ -2824,7 +2834,7 @@ function ownKeys(target) {
2824
2834
  }
2825
2835
  const mutableHandlers = {
2826
2836
  get,
2827
- set: set$1,
2837
+ set,
2828
2838
  deleteProperty,
2829
2839
  has,
2830
2840
  ownKeys
@@ -2892,7 +2902,7 @@ function add(value2) {
2892
2902
  }
2893
2903
  return this;
2894
2904
  }
2895
- function set$1$1(key2, value2) {
2905
+ function set$1(key2, value2) {
2896
2906
  value2 = toRaw(value2);
2897
2907
  const target = toRaw(this);
2898
2908
  const { has: has2, get: get2 } = getProto(target);
@@ -2985,7 +2995,7 @@ function createInstrumentations() {
2985
2995
  },
2986
2996
  has: has$1,
2987
2997
  add,
2988
- set: set$1$1,
2998
+ set: set$1,
2989
2999
  delete: deleteEntry,
2990
3000
  clear,
2991
3001
  forEach: createForEach(false, false)
@@ -2999,7 +3009,7 @@ function createInstrumentations() {
2999
3009
  },
3000
3010
  has: has$1,
3001
3011
  add,
3002
- set: set$1$1,
3012
+ set: set$1,
3003
3013
  delete: deleteEntry,
3004
3014
  clear,
3005
3015
  forEach: createForEach(false, true)
@@ -7671,9 +7681,9 @@ const OTTLoginState = reactive({
7671
7681
  });
7672
7682
  async function init(params) {
7673
7683
  const newParams = reconstructParams(params);
7674
- await execute$c(newParams);
7684
+ await execute$d(newParams);
7675
7685
  }
7676
- async function execute$c(params) {
7686
+ async function execute$d(params) {
7677
7687
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
7678
7688
  try {
7679
7689
  saveEnv((_a = params == null ? void 0 : params.env) != null ? _a : "");
@@ -8515,7 +8525,7 @@ const _sfc_main$1A = defineComponent({
8515
8525
  try {
8516
8526
  const url = new URL(buttonInfo.deeplink);
8517
8527
  const urlParam = url.searchParams.get("url");
8518
- if (buttonInfo.deeplink.startsWith("paypay://") && url.host === "embed" && urlParam) {
8528
+ if (buttonInfo.deeplink.startsWith("paypay://") && (url.host === "embed" || url.pathname === "//embed") && urlParam) {
8519
8529
  openWebviewInternal({ url: urlParam });
8520
8530
  return;
8521
8531
  }
@@ -8926,36 +8936,49 @@ const PermissionName = {
8926
8936
  mini_app_user_address: "mini_app_user_address",
8927
8937
  mini_app_user_phone_camera: "mini_app_user_phone_camera",
8928
8938
  mini_app_user_phone_album: "mini_app_user_phone_album",
8929
- mini_app_bank_information: "mini_app_bank_information"
8939
+ mini_app_bank_information: "mini_app_bank_information",
8940
+ mini_app_cashback_information: "mini_app_cashback_information"
8930
8941
  };
8931
8942
  const checkPermission = async (permissionNames) => {
8932
8943
  var _a;
8933
- if ((_a = getAppDetail()) == null ? void 0 : _a.isInternal) {
8934
- return PermissionStatus.granted;
8935
- }
8936
- const resPermission = await getUserGrantedPermission();
8937
- permissionNames = Array.isArray(permissionNames) ? permissionNames : [permissionNames];
8938
- for (const permissionName of permissionNames) {
8939
- if (!(resPermission == null ? void 0 : resPermission.find((name2) => name2 === permissionName))) {
8940
- return PermissionStatus.denied;
8944
+ try {
8945
+ if ((_a = getAppDetail()) == null ? void 0 : _a.isInternal) {
8946
+ return PermissionStatus.granted;
8941
8947
  }
8948
+ const resPermission = await getUserGrantedPermission();
8949
+ permissionNames = Array.isArray(permissionNames) ? permissionNames : [permissionNames];
8950
+ for (const permissionName of permissionNames) {
8951
+ if (!(resPermission == null ? void 0 : resPermission.find((name2) => name2 === permissionName))) {
8952
+ return PermissionStatus.denied;
8953
+ }
8954
+ }
8955
+ return PermissionStatus.granted;
8956
+ } catch {
8957
+ throw Error(MiniAppErrorType.serverError);
8942
8958
  }
8943
- return PermissionStatus.granted;
8944
8959
  };
8945
8960
  async function getUserGrantedPermission() {
8946
8961
  var _a, _b, _c, _d;
8947
- const response = await ppFetch2({
8948
- method: "GET",
8949
- url: "web-api/app/v1/users/permissions/granted"
8950
- });
8951
- return (response == null ? void 0 : response.ppFetchResult) === "success" ? (_d = (_c = (_b = (_a = response == null ? void 0 : response.body) == null ? void 0 : _a.unsigned) == null ? void 0 : _b.data) == null ? void 0 : _c.scopes) != null ? _d : [] : [];
8962
+ try {
8963
+ const response = await ppFetch2({
8964
+ method: "GET",
8965
+ url: "web-api/app/v1/users/permissions/granted"
8966
+ });
8967
+ if ((response == null ? void 0 : response.ppFetchResult) !== "success") {
8968
+ throw Error(MiniAppErrorType.serverError);
8969
+ } else {
8970
+ return (_d = (_c = (_b = (_a = response == null ? void 0 : response.body) == null ? void 0 : _a.unsigned) == null ? void 0 : _b.data) == null ? void 0 : _c.scopes) != null ? _d : [];
8971
+ }
8972
+ } catch {
8973
+ throw Error(MiniAppErrorType.serverError);
8974
+ }
8952
8975
  }
8953
8976
  async function getBalance(params) {
8954
8977
  const newParams = reconstructParams(params);
8955
- await execute$b(newParams);
8978
+ await execute$c(newParams);
8956
8979
  }
8957
- async function execute$b(params) {
8958
- var _a, _b, _c, _d, _e, _f, _g, _h;
8980
+ async function execute$c(params) {
8981
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
8959
8982
  try {
8960
8983
  const grantStatus = await checkPermission(PermissionName.mini_app_payment_balance);
8961
8984
  if (grantStatus !== PermissionStatus.granted) {
@@ -8976,13 +8999,15 @@ async function execute$b(params) {
8976
8999
  const newBalance = (_f = (_e = (_d = (_c = res == null ? void 0 : res.body) == null ? void 0 : _c.unsigned) == null ? void 0 : _d.data) == null ? void 0 : _e.totalBalance) == null ? void 0 : _f.amount;
8977
9000
  return (_g = params == null ? void 0 : params.success) == null ? void 0 : _g.call(params, { balance: newBalance });
8978
9001
  }
9002
+ } catch {
9003
+ return (_h = params == null ? void 0 : params.fail) == null ? void 0 : _h.call(params, { errorCode: MiniAppErrorType.serverError });
8979
9004
  } finally {
8980
9005
  }
8981
- return (_h = params == null ? void 0 : params.fail) == null ? void 0 : _h.call(params, { errorCode: MiniAppErrorType.serverError });
9006
+ return (_i = params == null ? void 0 : params.fail) == null ? void 0 : _i.call(params, { errorCode: MiniAppErrorType.serverError });
8982
9007
  }
8983
9008
  async function getAuthStatus(params) {
8984
9009
  const newParams = reconstructParams(params);
8985
- await execute$a(newParams);
9010
+ await execute$b(newParams);
8986
9011
  }
8987
9012
  async function handlePKCE() {
8988
9013
  const codeVerifier = generateCodeVerifier();
@@ -9004,7 +9029,7 @@ async function handleFailCallback(params, errorCode) {
9004
9029
  code
9005
9030
  });
9006
9031
  }
9007
- async function execute$a(params) {
9032
+ async function execute$b(params) {
9008
9033
  var _a, _b, _c, _d, _e, _f;
9009
9034
  try {
9010
9035
  const clientId = getClientId();
@@ -26307,8 +26332,8 @@ const _sfc_main$1a = defineComponent({
26307
26332
  buttonDisabled.value = !editOK;
26308
26333
  }
26309
26334
  });
26310
- const open2 = computed(() => props.open);
26311
- watch(open2, (newOpen, prevOpen) => {
26335
+ const open = computed(() => props.open);
26336
+ watch(open, (newOpen, prevOpen) => {
26312
26337
  if (newOpen === false && prevOpen === true) {
26313
26338
  Object.assign(state, createInitialState$1());
26314
26339
  } else {
@@ -26512,12 +26537,12 @@ const _sfc_main$19 = defineComponent({
26512
26537
  const lg2 = getLanguage();
26513
26538
  const style = useCssModule();
26514
26539
  const close2 = () => emit("close");
26515
- const del2 = () => emit("del");
26540
+ const del = () => emit("del");
26516
26541
  const img2 = getImages();
26517
26542
  return {
26518
26543
  style,
26519
26544
  close: close2,
26520
- del: del2,
26545
+ del,
26521
26546
  lg: lg2,
26522
26547
  img: img2
26523
26548
  };
@@ -26892,7 +26917,7 @@ const _sfc_main$17 = defineComponent({
26892
26917
  return handleError2();
26893
26918
  }
26894
26919
  };
26895
- const del2 = async () => {
26920
+ const del = async () => {
26896
26921
  var _a, _b, _c;
26897
26922
  const addressListResponse = await getAddressList();
26898
26923
  if ((addressListResponse == null ? void 0 : addressListResponse.ppFetchResult) === "success") {
@@ -26927,7 +26952,7 @@ const _sfc_main$17 = defineComponent({
26927
26952
  addAddress: addAddress2,
26928
26953
  addSheetLoading: computed(() => state.addSheetLoading),
26929
26954
  addressList: computed(() => state.addressList),
26930
- del: del2,
26955
+ del,
26931
26956
  isDesktopPay,
26932
26957
  addOrEdit,
26933
26958
  triggerLayoutUpdate,
@@ -28034,7 +28059,7 @@ const _sfc_main$11 = defineComponent({
28034
28059
  },
28035
28060
  setup(props, { emit }) {
28036
28061
  const images2 = getImages();
28037
- const click2 = () => emit("click");
28062
+ const click = () => emit("click");
28038
28063
  const style = useCssModule();
28039
28064
  const cashBackInfo2 = computed(() => {
28040
28065
  var _a, _b, _c, _d, _e, _f;
@@ -28057,7 +28082,7 @@ const _sfc_main$11 = defineComponent({
28057
28082
  return cashBackInfo2.value.cashBackAmount;
28058
28083
  });
28059
28084
  return {
28060
- click: click2,
28085
+ click,
28061
28086
  style,
28062
28087
  cashBackInfo: cashBackInfo2,
28063
28088
  images: images2,
@@ -28426,7 +28451,7 @@ const _sfc_main$10 = defineComponent({
28426
28451
  millisecond: true,
28427
28452
  onFinish: () => {
28428
28453
  isCountDown.value = false;
28429
- click2();
28454
+ click();
28430
28455
  countDown.reset();
28431
28456
  }
28432
28457
  });
@@ -28449,7 +28474,7 @@ const _sfc_main$10 = defineComponent({
28449
28474
  state.showShrinkAnimation = false;
28450
28475
  }, timeout);
28451
28476
  };
28452
- const click2 = () => {
28477
+ const click = () => {
28453
28478
  if (state.showCashBackDetailList || props.hasCashBackAnimation && isMobile.value || props.hasCashBackAnimation && !props.hasConfirmAge && isDesktop.value)
28454
28479
  return;
28455
28480
  context.emit("success");
@@ -28482,7 +28507,7 @@ const _sfc_main$10 = defineComponent({
28482
28507
  }),
28483
28508
  statusLabelColor: computed(() => props.paymentResult.statusLabelColor.toLowerCase()),
28484
28509
  labelText: computed(() => props.paymentResult.statusLabelString),
28485
- click: click2,
28510
+ click,
28486
28511
  copy,
28487
28512
  showCashBackDetailList: computed(() => state.showCashBackDetailList),
28488
28513
  openCashBackDetailList,
@@ -29691,13 +29716,13 @@ const _sfc_main$U = defineComponent({
29691
29716
  },
29692
29717
  setup(props, { emit }) {
29693
29718
  const style = useCssModule();
29694
- const click2 = (price2) => {
29719
+ const click = (price2) => {
29695
29720
  emit("click", price2);
29696
29721
  };
29697
29722
  return {
29698
29723
  style,
29699
29724
  numberWithCommas,
29700
- click: click2
29725
+ click
29701
29726
  };
29702
29727
  }
29703
29728
  });
@@ -32229,8 +32254,6 @@ const _sfc_main$M = defineComponent({
32229
32254
  if (!alwaysDisplay)
32230
32255
  showPaymentResult(res.unsigned.data);
32231
32256
  (cashBackInfo2 == null ? void 0 : cashBackInfo2.cashBackDetail) && handleCashBackDetails(cashBackInfo2.cashBackDetail);
32232
- } else {
32233
- endApplication();
32234
32257
  }
32235
32258
  });
32236
32259
  };
@@ -32850,7 +32873,7 @@ function createWrapComplete(fn) {
32850
32873
  };
32851
32874
  }
32852
32875
  const makePayment = async (params) => {
32853
- var _a, _b, _c, _d, _e, _f;
32876
+ var _a, _b, _c, _d, _e, _f, _g, _h;
32854
32877
  if ((params == null ? void 0 : params.alwaysDisplayCompletionScreen) && (params == null ? void 0 : params.alwaysHideCompletionScreen)) {
32855
32878
  (_a = params == null ? void 0 : params.fail) == null ? void 0 : _a.call(params, {
32856
32879
  errorCode: MiniAppErrorType.badRequest
@@ -32858,12 +32881,19 @@ const makePayment = async (params) => {
32858
32881
  return (_b = params == null ? void 0 : params.complete) == null ? void 0 : _b.call(params);
32859
32882
  }
32860
32883
  if ((_d = (_c = params == null ? void 0 : params.additionalUserInfo) == null ? void 0 : _c.userAddress) == null ? void 0 : _d.visible) {
32861
- const grantStatus = await checkPermission(PermissionName.mini_app_user_address);
32862
- if (grantStatus !== PermissionStatus.granted) {
32863
- (_e = params == null ? void 0 : params.fail) == null ? void 0 : _e.call(params, {
32864
- errorCode: MiniAppErrorType.insufficientScope
32884
+ try {
32885
+ const grantStatus = await checkPermission(PermissionName.mini_app_user_address);
32886
+ if (grantStatus !== PermissionStatus.granted) {
32887
+ (_e = params == null ? void 0 : params.fail) == null ? void 0 : _e.call(params, {
32888
+ errorCode: MiniAppErrorType.insufficientScope
32889
+ });
32890
+ return (_f = params == null ? void 0 : params.complete) == null ? void 0 : _f.call(params);
32891
+ }
32892
+ } catch {
32893
+ (_g = params == null ? void 0 : params.fail) == null ? void 0 : _g.call(params, {
32894
+ errorCode: MiniAppErrorType.serverError
32865
32895
  });
32866
- return (_f = params == null ? void 0 : params.complete) == null ? void 0 : _f.call(params);
32896
+ return (_h = params == null ? void 0 : params.complete) == null ? void 0 : _h.call(params);
32867
32897
  }
32868
32898
  }
32869
32899
  const success2 = params.success;
@@ -33033,7 +33063,7 @@ const _sfc_main$K = defineComponent({
33033
33063
  },
33034
33064
  setup(props, { emit }) {
33035
33065
  const style = useCssModule();
33036
- const click2 = (item2, index2) => {
33066
+ const click = (item2, index2) => {
33037
33067
  emit("click", item2, index2);
33038
33068
  };
33039
33069
  return {
@@ -33053,7 +33083,7 @@ const _sfc_main$K = defineComponent({
33053
33083
  var _a, _b, _c;
33054
33084
  return (_c = (_b = (_a = props == null ? void 0 : props.selectedPaymentMethod) == null ? void 0 : _a.descriptionBannerInfo) == null ? void 0 : _b.displayResponse) == null ? void 0 : _c.buttonList;
33055
33085
  }),
33056
- click: click2,
33086
+ click,
33057
33087
  style
33058
33088
  };
33059
33089
  }
@@ -34194,17 +34224,14 @@ function removeStorageData(params) {
34194
34224
  }
34195
34225
  async function getPermissionStatus(params) {
34196
34226
  const newParams = reconstructParams(params);
34197
- await execute$9(newParams);
34227
+ await execute$a(newParams);
34198
34228
  }
34199
- async function execute$9(params) {
34200
- var _a, _b, _c, _d;
34229
+ async function execute$a(params) {
34230
+ var _a, _b, _c;
34201
34231
  try {
34202
34232
  const permissionList = await getUserGrantedPermission();
34203
- if (!permissionList) {
34204
- return (_a = params == null ? void 0 : params.fail) == null ? void 0 : _a.call(params, { errorCode: MiniAppErrorType.serverError });
34205
- }
34206
34233
  if (!(params == null ? void 0 : params.name)) {
34207
- return (_b = params == null ? void 0 : params.success) == null ? void 0 : _b.call(params, {
34234
+ return (_a = params == null ? void 0 : params.success) == null ? void 0 : _a.call(params, {
34208
34235
  granted_permissions: permissionList
34209
34236
  });
34210
34237
  } else {
@@ -34212,10 +34239,10 @@ async function execute$9(params) {
34212
34239
  return name2 === (params == null ? void 0 : params.name);
34213
34240
  });
34214
34241
  const status2 = thePermission ? PermissionStatus.granted : PermissionStatus.denied;
34215
- return (_c = params == null ? void 0 : params.success) == null ? void 0 : _c.call(params, { status: status2 });
34242
+ return (_b = params == null ? void 0 : params.success) == null ? void 0 : _b.call(params, { status: status2 });
34216
34243
  }
34217
34244
  } catch (_) {
34218
- return (_d = params == null ? void 0 : params.fail) == null ? void 0 : _d.call(params, { errorCode: MiniAppErrorType.serverError });
34245
+ return (_c = params == null ? void 0 : params.fail) == null ? void 0 : _c.call(params, { errorCode: MiniAppErrorType.serverError });
34219
34246
  }
34220
34247
  }
34221
34248
  function scanCode(_params) {
@@ -34625,9 +34652,9 @@ function showUpdateWarning$1(params) {
34625
34652
  }
34626
34653
  async function getPlatformInformation(params) {
34627
34654
  const newParams = reconstructParams(params);
34628
- await execute$8(newParams);
34655
+ await execute$9(newParams);
34629
34656
  }
34630
- async function execute$8(params) {
34657
+ async function execute$9(params) {
34631
34658
  var _a, _b;
34632
34659
  let sdkVersion = null;
34633
34660
  let preferredLanguage = getPayPayLanguage();
@@ -34656,9 +34683,9 @@ async function execute$8(params) {
34656
34683
  }
34657
34684
  function getDeviceInformation(params) {
34658
34685
  const newParams = reconstructParams(params);
34659
- execute$7(newParams);
34686
+ execute$8(newParams);
34660
34687
  }
34661
- function execute$7(params) {
34688
+ function execute$8(params) {
34662
34689
  var _a;
34663
34690
  const runtime = getRuntime();
34664
34691
  (_a = params == null ? void 0 : params.success) == null ? void 0 : _a.call(params, {
@@ -34860,9 +34887,9 @@ async function share(shareParams) {
34860
34887
  }
34861
34888
  async function getKycInformation(params) {
34862
34889
  const newParams = reconstructParams(params);
34863
- await execute$6(newParams);
34890
+ await execute$7(newParams);
34864
34891
  }
34865
- async function execute$6(params) {
34892
+ async function execute$7(params) {
34866
34893
  var _a, _b, _c, _d, _e, _f, _g, _h;
34867
34894
  try {
34868
34895
  const grantStatus = await checkPermission(PermissionName.mini_app_kyc);
@@ -34892,18 +34919,24 @@ async function execute$6(params) {
34892
34919
  }
34893
34920
  }
34894
34921
  const initGetUserAddress = async (params) => {
34895
- var _a, _b;
34896
- const grantStatus = await checkPermission(PermissionName.mini_app_user_address);
34897
- if (grantStatus !== PermissionStatus.granted) {
34898
- return (_a = params == null ? void 0 : params.fail) == null ? void 0 : _a.call(params, {
34899
- errorCode: MiniAppErrorType.insufficientScope
34922
+ var _a, _b, _c;
34923
+ try {
34924
+ const grantStatus = await checkPermission(PermissionName.mini_app_user_address);
34925
+ if (grantStatus !== PermissionStatus.granted) {
34926
+ return (_a = params == null ? void 0 : params.fail) == null ? void 0 : _a.call(params, {
34927
+ errorCode: MiniAppErrorType.insufficientScope
34928
+ });
34929
+ }
34930
+ } catch {
34931
+ return (_b = params == null ? void 0 : params.fail) == null ? void 0 : _b.call(params, {
34932
+ errorCode: MiniAppErrorType.serverError
34900
34933
  });
34901
34934
  }
34902
34935
  const container2 = document.createElement("div");
34903
34936
  container2.className = "ppmna-reset-css";
34904
34937
  const res = await getAddressList();
34905
34938
  if ((res == null ? void 0 : res.ppFetchResult) !== "success") {
34906
- (_b = params == null ? void 0 : params.fail) == null ? void 0 : _b.call(params, {
34939
+ (_c = params == null ? void 0 : params.fail) == null ? void 0 : _c.call(params, {
34907
34940
  errorCode: getFailErrorCode(res == null ? void 0 : res.ppFetchResult)
34908
34941
  });
34909
34942
  return;
@@ -34916,24 +34949,14 @@ const initGetUserAddress = async (params) => {
34916
34949
  app.unmount();
34917
34950
  }, 300);
34918
34951
  };
34919
- const app = createApp(__spreadProps(__spreadValues({
34920
- setup() {
34921
- const close2 = () => {
34922
- closeSheet();
34923
- };
34924
- return {
34925
- show: show2,
34926
- close: close2
34927
- };
34928
- }
34929
- }, popStateHandler(closeSheet, params)), {
34952
+ const app = createApp(__spreadProps(__spreadValues({}, popStateHandler(closeSheet, params)), {
34930
34953
  render() {
34931
- var _a2, _b2, _c;
34954
+ var _a2, _b2, _c2;
34932
34955
  return h(AppVue$7, {
34933
- show: this.show,
34934
- onClick: this.close,
34956
+ show: show2.value,
34957
+ onClick: closeSheet,
34935
34958
  getUserAddressParams: params,
34936
- addresses: (_c = (_b2 = (_a2 = res == null ? void 0 : res.body) == null ? void 0 : _a2.unsigned) == null ? void 0 : _b2.data) == null ? void 0 : _c.addresses
34959
+ addresses: (_c2 = (_b2 = (_a2 = res == null ? void 0 : res.body) == null ? void 0 : _a2.unsigned) == null ? void 0 : _b2.data) == null ? void 0 : _c2.addresses
34937
34960
  });
34938
34961
  }
34939
34962
  }));
@@ -35121,21 +35144,11 @@ const initInputAddress = (params) => {
35121
35144
  app.unmount();
35122
35145
  }, 300);
35123
35146
  };
35124
- const app = createApp(__spreadProps(__spreadValues({
35125
- setup() {
35126
- const close2 = () => {
35127
- closeSheet();
35128
- };
35129
- return {
35130
- show: show2,
35131
- close: close2
35132
- };
35133
- }
35134
- }, popStateHandler(closeSheet, params)), {
35147
+ const app = createApp(__spreadProps(__spreadValues({}, popStateHandler(closeSheet, params)), {
35135
35148
  render() {
35136
35149
  return h(AppView, {
35137
- show: this.show,
35138
- onClick: this.close,
35150
+ show: show2.value,
35151
+ onClick: closeSheet,
35139
35152
  inputAddressParams: params
35140
35153
  });
35141
35154
  }
@@ -35252,12 +35265,12 @@ async function checkPaymentMethod(checkPayMethodParams) {
35252
35265
  }
35253
35266
  function debug(params) {
35254
35267
  const newParams = reconstructParams(params);
35255
- execute$5(newParams);
35268
+ execute$6(newParams);
35256
35269
  }
35257
- function execute$5(params) {
35270
+ function execute$6(params) {
35258
35271
  var _a;
35259
35272
  (_a = params == null ? void 0 : params.success) == null ? void 0 : _a.call(params, {
35260
- v: "1.49.0"
35273
+ v: "1.51.0"
35261
35274
  });
35262
35275
  }
35263
35276
  function useCallBack(props, ctx) {
@@ -36359,25 +36372,31 @@ function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
36359
36372
  }
36360
36373
  var AppVue$1 = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["render", _sfc_render$y]]);
36361
36374
  async function initRegisterEmail(initRegisterEmail2, allowsUpdate) {
36362
- var _a, _b, _c, _d, _e, _f, _g;
36363
- const grantStatus = await checkPermission(PermissionName.mini_app_user_email_address);
36364
- if (grantStatus !== PermissionStatus.granted) {
36365
- return (_a = initRegisterEmail2 == null ? void 0 : initRegisterEmail2.fail) == null ? void 0 : _a.call(initRegisterEmail2, {
36366
- errorCode: MiniAppErrorType.insufficientScope
36375
+ var _a, _b, _c, _d, _e, _f, _g, _h;
36376
+ try {
36377
+ const grantStatus = await checkPermission(PermissionName.mini_app_user_email_address);
36378
+ if (grantStatus !== PermissionStatus.granted) {
36379
+ return (_a = initRegisterEmail2 == null ? void 0 : initRegisterEmail2.fail) == null ? void 0 : _a.call(initRegisterEmail2, {
36380
+ errorCode: MiniAppErrorType.insufficientScope
36381
+ });
36382
+ }
36383
+ } catch {
36384
+ return (_b = initRegisterEmail2 == null ? void 0 : initRegisterEmail2.fail) == null ? void 0 : _b.call(initRegisterEmail2, {
36385
+ errorCode: MiniAppErrorType.serverError
36367
36386
  });
36368
36387
  }
36369
36388
  const res = await getUserProfileDataV2();
36370
36389
  if (res.ppFetchResult !== "success") {
36371
- (_b = initRegisterEmail2 == null ? void 0 : initRegisterEmail2.fail) == null ? void 0 : _b.call(initRegisterEmail2, {
36390
+ (_c = initRegisterEmail2 == null ? void 0 : initRegisterEmail2.fail) == null ? void 0 : _c.call(initRegisterEmail2, {
36372
36391
  errorCode: MiniAppErrorType.serverError
36373
36392
  });
36374
36393
  return;
36375
36394
  }
36376
- const email2 = (_d = (_c = res.body.unsigned) == null ? void 0 : _c.data) == null ? void 0 : _d.email;
36395
+ const email2 = (_e = (_d = res.body.unsigned) == null ? void 0 : _d.data) == null ? void 0 : _e.email;
36377
36396
  const emailRegistered = !!email2;
36378
- const emailVerified = ((_f = (_e = res.body.unsigned) == null ? void 0 : _e.data) == null ? void 0 : _f.emailStatus) === "VERIFIED";
36397
+ const emailVerified = ((_g = (_f = res.body.unsigned) == null ? void 0 : _f.data) == null ? void 0 : _g.emailStatus) === "VERIFIED";
36379
36398
  if (emailRegistered && emailVerified && !allowsUpdate) {
36380
- (_g = initRegisterEmail2 == null ? void 0 : initRegisterEmail2.success) == null ? void 0 : _g.call(initRegisterEmail2, {
36399
+ (_h = initRegisterEmail2 == null ? void 0 : initRegisterEmail2.success) == null ? void 0 : _h.call(initRegisterEmail2, {
36381
36400
  statusCode: MiniAppStatusType.emailRegistered,
36382
36401
  email: email2
36383
36402
  });
@@ -36392,22 +36411,12 @@ async function initRegisterEmail(initRegisterEmail2, allowsUpdate) {
36392
36411
  }, 350);
36393
36412
  };
36394
36413
  const resendOption = allowsUpdate && email2 && !emailVerified ? { resend: true, maskedEmail: email2 } : null;
36395
- const app = createApp(__spreadProps(__spreadValues({
36396
- setup() {
36397
- const closeApp2 = () => {
36398
- closeSheet();
36399
- };
36400
- return {
36401
- show: show2,
36402
- closeApp: closeApp2
36403
- };
36404
- }
36405
- }, popStateHandler(closeSheet, initRegisterEmail2)), {
36414
+ const app = createApp(__spreadProps(__spreadValues({}, popStateHandler(closeSheet, initRegisterEmail2)), {
36406
36415
  render() {
36407
36416
  return h(AppVue$1, {
36408
- show: this.show,
36417
+ show: show2.value,
36409
36418
  params: initRegisterEmail2,
36410
- onClick: this.closeApp,
36419
+ onClick: closeSheet,
36411
36420
  resendOption
36412
36421
  });
36413
36422
  }
@@ -36424,9 +36433,9 @@ function registerEmail(params, allowsUpdate = false) {
36424
36433
  }
36425
36434
  function registerKyc(params) {
36426
36435
  const newParams = reconstructParams(params);
36427
- execute$4(newParams);
36436
+ execute$5(newParams);
36428
36437
  }
36429
- function execute$4(params) {
36438
+ function execute$5(params) {
36430
36439
  var _a;
36431
36440
  params = __spreadProps(__spreadValues({}, params), {
36432
36441
  type: (params == null ? void 0 : params.type) || "EKYC"
@@ -36464,13 +36473,13 @@ function execute$4(params) {
36464
36473
  }
36465
36474
  async function startMultiFactorAuth(params) {
36466
36475
  const newParams = reconstructParams(params);
36467
- await execute$3(newParams);
36476
+ await execute$4(newParams);
36468
36477
  }
36469
36478
  function validType(params) {
36470
36479
  const authTypes = ["BIOMETRIC"];
36471
36480
  return authTypes.includes(params == null ? void 0 : params.type);
36472
36481
  }
36473
- async function execute$3(params) {
36482
+ async function execute$4(params) {
36474
36483
  var _a, _b, _c, _d, _e, _f, _g, _h, _i;
36475
36484
  if (!validType(params)) {
36476
36485
  return (_a = params == null ? void 0 : params.fail) == null ? void 0 : _a.call(params, { errorCode: MiniAppErrorType.invalidType });
@@ -36500,9 +36509,9 @@ async function execute$3(params) {
36500
36509
  }
36501
36510
  function logout(params) {
36502
36511
  const newParams = reconstructParams(params);
36503
- execute$2(newParams);
36512
+ execute$3(newParams);
36504
36513
  }
36505
- function execute$2(params) {
36514
+ function execute$3(params) {
36506
36515
  var _a, _b;
36507
36516
  try {
36508
36517
  Object.entries(PpLocalStorageKey).forEach(([_, value2]) => {
@@ -36517,9 +36526,9 @@ function execute$2(params) {
36517
36526
  }
36518
36527
  async function verifyMultiFactorAuthResult(params) {
36519
36528
  const newParams = reconstructParams(params);
36520
- await execute$1(newParams);
36529
+ await execute$2(newParams);
36521
36530
  }
36522
- async function execute$1(params) {
36531
+ async function execute$2(params) {
36523
36532
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
36524
36533
  const urlParams = new URLSearchParams(window.location.search);
36525
36534
  const sessionId = urlParams == null ? void 0 : urlParams.get("ppSessionId");
@@ -37283,177 +37292,14 @@ function callbackHandler(params, callback) {
37283
37292
  }
37284
37293
  }
37285
37294
  var isVue2 = false;
37286
- function set(target, key2, val2) {
37287
- if (Array.isArray(target)) {
37288
- target.length = Math.max(target.length, key2);
37289
- target.splice(key2, 1, val2);
37290
- return val2;
37291
- }
37292
- target[key2] = val2;
37293
- return val2;
37294
- }
37295
- function del(target, key2) {
37296
- if (Array.isArray(target)) {
37297
- target.splice(key2, 1);
37298
- return;
37299
- }
37300
- delete target[key2];
37301
- }
37302
- function getDevtoolsGlobalHook() {
37303
- return getTarget().__VUE_DEVTOOLS_GLOBAL_HOOK__;
37304
- }
37305
- function getTarget() {
37306
- return typeof navigator !== "undefined" && typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {};
37307
- }
37308
- const isProxyAvailable = typeof Proxy === "function";
37309
- const HOOK_SETUP = "devtools-plugin:setup";
37310
- const HOOK_PLUGIN_SETTINGS_SET = "plugin:settings:set";
37311
- let supported;
37312
- let perf;
37313
- function isPerformanceSupported() {
37314
- var _a;
37315
- if (supported !== void 0) {
37316
- return supported;
37317
- }
37318
- if (typeof window !== "undefined" && window.performance) {
37319
- supported = true;
37320
- perf = window.performance;
37321
- } else if (typeof global !== "undefined" && ((_a = global.perf_hooks) === null || _a === void 0 ? void 0 : _a.performance)) {
37322
- supported = true;
37323
- perf = global.perf_hooks.performance;
37324
- } else {
37325
- supported = false;
37326
- }
37327
- return supported;
37328
- }
37329
- function now() {
37330
- return isPerformanceSupported() ? perf.now() : Date.now();
37331
- }
37332
- class ApiProxy {
37333
- constructor(plugin, hook) {
37334
- this.target = null;
37335
- this.targetQueue = [];
37336
- this.onQueue = [];
37337
- this.plugin = plugin;
37338
- this.hook = hook;
37339
- const defaultSettings = {};
37340
- if (plugin.settings) {
37341
- for (const id in plugin.settings) {
37342
- const item2 = plugin.settings[id];
37343
- defaultSettings[id] = item2.defaultValue;
37344
- }
37345
- }
37346
- const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`;
37347
- let currentSettings = Object.assign({}, defaultSettings);
37348
- try {
37349
- const raw = localStorage.getItem(localSettingsSaveId);
37350
- const data2 = JSON.parse(raw);
37351
- Object.assign(currentSettings, data2);
37352
- } catch (e) {
37353
- }
37354
- this.fallbacks = {
37355
- getSettings() {
37356
- return currentSettings;
37357
- },
37358
- setSettings(value2) {
37359
- try {
37360
- localStorage.setItem(localSettingsSaveId, JSON.stringify(value2));
37361
- } catch (e) {
37362
- }
37363
- currentSettings = value2;
37364
- },
37365
- now() {
37366
- return now();
37367
- }
37368
- };
37369
- if (hook) {
37370
- hook.on(HOOK_PLUGIN_SETTINGS_SET, (pluginId, value2) => {
37371
- if (pluginId === this.plugin.id) {
37372
- this.fallbacks.setSettings(value2);
37373
- }
37374
- });
37375
- }
37376
- this.proxiedOn = new Proxy({}, {
37377
- get: (_target, prop) => {
37378
- if (this.target) {
37379
- return this.target.on[prop];
37380
- } else {
37381
- return (...args) => {
37382
- this.onQueue.push({
37383
- method: prop,
37384
- args
37385
- });
37386
- };
37387
- }
37388
- }
37389
- });
37390
- this.proxiedTarget = new Proxy({}, {
37391
- get: (_target, prop) => {
37392
- if (this.target) {
37393
- return this.target[prop];
37394
- } else if (prop === "on") {
37395
- return this.proxiedOn;
37396
- } else if (Object.keys(this.fallbacks).includes(prop)) {
37397
- return (...args) => {
37398
- this.targetQueue.push({
37399
- method: prop,
37400
- args,
37401
- resolve: () => {
37402
- }
37403
- });
37404
- return this.fallbacks[prop](...args);
37405
- };
37406
- } else {
37407
- return (...args) => {
37408
- return new Promise((resolve2) => {
37409
- this.targetQueue.push({
37410
- method: prop,
37411
- args,
37412
- resolve: resolve2
37413
- });
37414
- });
37415
- };
37416
- }
37417
- }
37418
- });
37419
- }
37420
- async setRealTarget(target) {
37421
- this.target = target;
37422
- for (const item2 of this.onQueue) {
37423
- this.target.on[item2.method](...item2.args);
37424
- }
37425
- for (const item2 of this.targetQueue) {
37426
- item2.resolve(await this.target[item2.method](...item2.args));
37427
- }
37428
- }
37429
- }
37430
- function setupDevtoolsPlugin(pluginDescriptor, setupFn) {
37431
- const descriptor = pluginDescriptor;
37432
- const target = getTarget();
37433
- const hook = getDevtoolsGlobalHook();
37434
- const enableProxy = isProxyAvailable && descriptor.enableEarlyProxy;
37435
- if (hook && (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !enableProxy)) {
37436
- hook.emit(HOOK_SETUP, pluginDescriptor, setupFn);
37437
- } else {
37438
- const proxy = enableProxy ? new ApiProxy(descriptor, hook) : null;
37439
- const list2 = target.__VUE_DEVTOOLS_PLUGINS__ = target.__VUE_DEVTOOLS_PLUGINS__ || [];
37440
- list2.push({
37441
- pluginDescriptor: descriptor,
37442
- setupFn,
37443
- proxy
37444
- });
37445
- if (proxy)
37446
- setupFn(proxy.proxiedTarget);
37447
- }
37448
- }
37449
37295
  /*!
37450
- * pinia v2.0.18
37296
+ * pinia v2.0.22
37451
37297
  * (c) 2022 Eduardo San Martin Morote
37452
37298
  * @license MIT
37453
37299
  */
37454
37300
  let activePinia;
37455
37301
  const setActivePinia = (pinia) => activePinia = pinia;
37456
- const piniaSymbol = Symbol("pinia");
37302
+ const piniaSymbol = Symbol();
37457
37303
  function isPlainObject(o) {
37458
37304
  return o && typeof o === "object" && Object.prototype.toString.call(o) === "[object Object]" && typeof o.toJSON !== "function";
37459
37305
  }
@@ -37463,721 +37309,6 @@ var MutationType;
37463
37309
  MutationType2["patchObject"] = "patch object";
37464
37310
  MutationType2["patchFunction"] = "patch function";
37465
37311
  })(MutationType || (MutationType = {}));
37466
- const IS_CLIENT = typeof window !== "undefined";
37467
- const _global = /* @__PURE__ */ (() => typeof window === "object" && window.window === window ? window : typeof self === "object" && self.self === self ? self : typeof global === "object" && global.global === global ? global : typeof globalThis === "object" ? globalThis : { HTMLElement: null })();
37468
- function bom(blob, { autoBom = false } = {}) {
37469
- if (autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) {
37470
- return new Blob([String.fromCharCode(65279), blob], { type: blob.type });
37471
- }
37472
- return blob;
37473
- }
37474
- function download(url, name2, opts) {
37475
- const xhr = new XMLHttpRequest();
37476
- xhr.open("GET", url);
37477
- xhr.responseType = "blob";
37478
- xhr.onload = function() {
37479
- saveAs(xhr.response, name2, opts);
37480
- };
37481
- xhr.onerror = function() {
37482
- console.error("could not download file");
37483
- };
37484
- xhr.send();
37485
- }
37486
- function corsEnabled(url) {
37487
- const xhr = new XMLHttpRequest();
37488
- xhr.open("HEAD", url, false);
37489
- try {
37490
- xhr.send();
37491
- } catch (e) {
37492
- }
37493
- return xhr.status >= 200 && xhr.status <= 299;
37494
- }
37495
- function click(node) {
37496
- try {
37497
- node.dispatchEvent(new MouseEvent("click"));
37498
- } catch (e) {
37499
- const evt = document.createEvent("MouseEvents");
37500
- evt.initMouseEvent("click", true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null);
37501
- node.dispatchEvent(evt);
37502
- }
37503
- }
37504
- const _navigator = typeof navigator === "object" ? navigator : { userAgent: "" };
37505
- const isMacOSWebView = /* @__PURE__ */ (() => /Macintosh/.test(_navigator.userAgent) && /AppleWebKit/.test(_navigator.userAgent) && !/Safari/.test(_navigator.userAgent))();
37506
- const saveAs = !IS_CLIENT ? () => {
37507
- } : typeof HTMLAnchorElement !== "undefined" && "download" in HTMLAnchorElement.prototype && !isMacOSWebView ? downloadSaveAs : "msSaveOrOpenBlob" in _navigator ? msSaveAs : fileSaverSaveAs;
37508
- function downloadSaveAs(blob, name2 = "download", opts) {
37509
- const a = document.createElement("a");
37510
- a.download = name2;
37511
- a.rel = "noopener";
37512
- if (typeof blob === "string") {
37513
- a.href = blob;
37514
- if (a.origin !== location.origin) {
37515
- if (corsEnabled(a.href)) {
37516
- download(blob, name2, opts);
37517
- } else {
37518
- a.target = "_blank";
37519
- click(a);
37520
- }
37521
- } else {
37522
- click(a);
37523
- }
37524
- } else {
37525
- a.href = URL.createObjectURL(blob);
37526
- setTimeout(function() {
37527
- URL.revokeObjectURL(a.href);
37528
- }, 4e4);
37529
- setTimeout(function() {
37530
- click(a);
37531
- }, 0);
37532
- }
37533
- }
37534
- function msSaveAs(blob, name2 = "download", opts) {
37535
- if (typeof blob === "string") {
37536
- if (corsEnabled(blob)) {
37537
- download(blob, name2, opts);
37538
- } else {
37539
- const a = document.createElement("a");
37540
- a.href = blob;
37541
- a.target = "_blank";
37542
- setTimeout(function() {
37543
- click(a);
37544
- });
37545
- }
37546
- } else {
37547
- navigator.msSaveOrOpenBlob(bom(blob, opts), name2);
37548
- }
37549
- }
37550
- function fileSaverSaveAs(blob, name2, opts, popup) {
37551
- popup = popup || open("", "_blank");
37552
- if (popup) {
37553
- popup.document.title = popup.document.body.innerText = "downloading...";
37554
- }
37555
- if (typeof blob === "string")
37556
- return download(blob, name2, opts);
37557
- const force = blob.type === "application/octet-stream";
37558
- const isSafari2 = /constructor/i.test(String(_global.HTMLElement)) || "safari" in _global;
37559
- const isChromeIOS = /CriOS\/[\d]+/.test(navigator.userAgent);
37560
- if ((isChromeIOS || force && isSafari2 || isMacOSWebView) && typeof FileReader !== "undefined") {
37561
- const reader = new FileReader();
37562
- reader.onloadend = function() {
37563
- let url = reader.result;
37564
- if (typeof url !== "string") {
37565
- popup = null;
37566
- throw new Error("Wrong reader.result type");
37567
- }
37568
- url = isChromeIOS ? url : url.replace(/^data:[^;]*;/, "data:attachment/file;");
37569
- if (popup) {
37570
- popup.location.href = url;
37571
- } else {
37572
- location.assign(url);
37573
- }
37574
- popup = null;
37575
- };
37576
- reader.readAsDataURL(blob);
37577
- } else {
37578
- const url = URL.createObjectURL(blob);
37579
- if (popup)
37580
- popup.location.assign(url);
37581
- else
37582
- location.href = url;
37583
- popup = null;
37584
- setTimeout(function() {
37585
- URL.revokeObjectURL(url);
37586
- }, 4e4);
37587
- }
37588
- }
37589
- function toastMessage(message, type) {
37590
- const piniaMessage = "\u{1F34D} " + message;
37591
- if (typeof __VUE_DEVTOOLS_TOAST__ === "function") {
37592
- __VUE_DEVTOOLS_TOAST__(piniaMessage, type);
37593
- } else if (type === "error") {
37594
- console.error(piniaMessage);
37595
- } else if (type === "warn") {
37596
- console.warn(piniaMessage);
37597
- } else {
37598
- console.log(piniaMessage);
37599
- }
37600
- }
37601
- function isPinia(o) {
37602
- return "_a" in o && "install" in o;
37603
- }
37604
- function checkClipboardAccess() {
37605
- if (!("clipboard" in navigator)) {
37606
- toastMessage(`Your browser doesn't support the Clipboard API`, "error");
37607
- return true;
37608
- }
37609
- }
37610
- function checkNotFocusedError(error2) {
37611
- if (error2 instanceof Error && error2.message.toLowerCase().includes("document is not focused")) {
37612
- toastMessage('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.', "warn");
37613
- return true;
37614
- }
37615
- return false;
37616
- }
37617
- async function actionGlobalCopyState(pinia) {
37618
- if (checkClipboardAccess())
37619
- return;
37620
- try {
37621
- await navigator.clipboard.writeText(JSON.stringify(pinia.state.value));
37622
- toastMessage("Global state copied to clipboard.");
37623
- } catch (error2) {
37624
- if (checkNotFocusedError(error2))
37625
- return;
37626
- toastMessage(`Failed to serialize the state. Check the console for more details.`, "error");
37627
- console.error(error2);
37628
- }
37629
- }
37630
- async function actionGlobalPasteState(pinia) {
37631
- if (checkClipboardAccess())
37632
- return;
37633
- try {
37634
- pinia.state.value = JSON.parse(await navigator.clipboard.readText());
37635
- toastMessage("Global state pasted from clipboard.");
37636
- } catch (error2) {
37637
- if (checkNotFocusedError(error2))
37638
- return;
37639
- toastMessage(`Failed to deserialize the state from clipboard. Check the console for more details.`, "error");
37640
- console.error(error2);
37641
- }
37642
- }
37643
- async function actionGlobalSaveState(pinia) {
37644
- try {
37645
- saveAs(new Blob([JSON.stringify(pinia.state.value)], {
37646
- type: "text/plain;charset=utf-8"
37647
- }), "pinia-state.json");
37648
- } catch (error2) {
37649
- toastMessage(`Failed to export the state as JSON. Check the console for more details.`, "error");
37650
- console.error(error2);
37651
- }
37652
- }
37653
- let fileInput;
37654
- function getFileOpener() {
37655
- if (!fileInput) {
37656
- fileInput = document.createElement("input");
37657
- fileInput.type = "file";
37658
- fileInput.accept = ".json";
37659
- }
37660
- function openFile() {
37661
- return new Promise((resolve2, reject) => {
37662
- fileInput.onchange = async () => {
37663
- const files = fileInput.files;
37664
- if (!files)
37665
- return resolve2(null);
37666
- const file = files.item(0);
37667
- if (!file)
37668
- return resolve2(null);
37669
- return resolve2({ text: await file.text(), file });
37670
- };
37671
- fileInput.oncancel = () => resolve2(null);
37672
- fileInput.onerror = reject;
37673
- fileInput.click();
37674
- });
37675
- }
37676
- return openFile;
37677
- }
37678
- async function actionGlobalOpenStateFile(pinia) {
37679
- try {
37680
- const open2 = await getFileOpener();
37681
- const result2 = await open2();
37682
- if (!result2)
37683
- return;
37684
- const { text: text2, file } = result2;
37685
- pinia.state.value = JSON.parse(text2);
37686
- toastMessage(`Global state imported from "${file.name}".`);
37687
- } catch (error2) {
37688
- toastMessage(`Failed to export the state as JSON. Check the console for more details.`, "error");
37689
- console.error(error2);
37690
- }
37691
- }
37692
- function formatDisplay(display) {
37693
- return {
37694
- _custom: {
37695
- display
37696
- }
37697
- };
37698
- }
37699
- const PINIA_ROOT_LABEL = "\u{1F34D} Pinia (root)";
37700
- const PINIA_ROOT_ID = "_root";
37701
- function formatStoreForInspectorTree(store) {
37702
- return isPinia(store) ? {
37703
- id: PINIA_ROOT_ID,
37704
- label: PINIA_ROOT_LABEL
37705
- } : {
37706
- id: store.$id,
37707
- label: store.$id
37708
- };
37709
- }
37710
- function formatStoreForInspectorState(store) {
37711
- if (isPinia(store)) {
37712
- const storeNames = Array.from(store._s.keys());
37713
- const storeMap = store._s;
37714
- const state2 = {
37715
- state: storeNames.map((storeId) => ({
37716
- editable: true,
37717
- key: storeId,
37718
- value: store.state.value[storeId]
37719
- })),
37720
- getters: storeNames.filter((id) => storeMap.get(id)._getters).map((id) => {
37721
- const store2 = storeMap.get(id);
37722
- return {
37723
- editable: false,
37724
- key: id,
37725
- value: store2._getters.reduce((getters, key2) => {
37726
- getters[key2] = store2[key2];
37727
- return getters;
37728
- }, {})
37729
- };
37730
- })
37731
- };
37732
- return state2;
37733
- }
37734
- const state = {
37735
- state: Object.keys(store.$state).map((key2) => ({
37736
- editable: true,
37737
- key: key2,
37738
- value: store.$state[key2]
37739
- }))
37740
- };
37741
- if (store._getters && store._getters.length) {
37742
- state.getters = store._getters.map((getterName) => ({
37743
- editable: false,
37744
- key: getterName,
37745
- value: store[getterName]
37746
- }));
37747
- }
37748
- if (store._customProperties.size) {
37749
- state.customProperties = Array.from(store._customProperties).map((key2) => ({
37750
- editable: true,
37751
- key: key2,
37752
- value: store[key2]
37753
- }));
37754
- }
37755
- return state;
37756
- }
37757
- function formatEventData(events) {
37758
- if (!events)
37759
- return {};
37760
- if (Array.isArray(events)) {
37761
- return events.reduce((data2, event) => {
37762
- data2.keys.push(event.key);
37763
- data2.operations.push(event.type);
37764
- data2.oldValue[event.key] = event.oldValue;
37765
- data2.newValue[event.key] = event.newValue;
37766
- return data2;
37767
- }, {
37768
- oldValue: {},
37769
- keys: [],
37770
- operations: [],
37771
- newValue: {}
37772
- });
37773
- } else {
37774
- return {
37775
- operation: formatDisplay(events.type),
37776
- key: formatDisplay(events.key),
37777
- oldValue: events.oldValue,
37778
- newValue: events.newValue
37779
- };
37780
- }
37781
- }
37782
- function formatMutationType(type) {
37783
- switch (type) {
37784
- case MutationType.direct:
37785
- return "mutation";
37786
- case MutationType.patchFunction:
37787
- return "$patch";
37788
- case MutationType.patchObject:
37789
- return "$patch";
37790
- default:
37791
- return "unknown";
37792
- }
37793
- }
37794
- let isTimelineActive = true;
37795
- const componentStateTypes = [];
37796
- const MUTATIONS_LAYER_ID = "pinia:mutations";
37797
- const INSPECTOR_ID = "pinia";
37798
- const getStoreType = (id) => "\u{1F34D} " + id;
37799
- function registerPiniaDevtools(app, pinia) {
37800
- setupDevtoolsPlugin({
37801
- id: "dev.esm.pinia",
37802
- label: "Pinia \u{1F34D}",
37803
- logo: "https://pinia.vuejs.org/logo.svg",
37804
- packageName: "pinia",
37805
- homepage: "https://pinia.vuejs.org",
37806
- componentStateTypes,
37807
- app
37808
- }, (api2) => {
37809
- if (typeof api2.now !== "function") {
37810
- toastMessage("You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html.");
37811
- }
37812
- api2.addTimelineLayer({
37813
- id: MUTATIONS_LAYER_ID,
37814
- label: `Pinia \u{1F34D}`,
37815
- color: 15064968
37816
- });
37817
- api2.addInspector({
37818
- id: INSPECTOR_ID,
37819
- label: "Pinia \u{1F34D}",
37820
- icon: "storage",
37821
- treeFilterPlaceholder: "Search stores",
37822
- actions: [
37823
- {
37824
- icon: "content_copy",
37825
- action: () => {
37826
- actionGlobalCopyState(pinia);
37827
- },
37828
- tooltip: "Serialize and copy the state"
37829
- },
37830
- {
37831
- icon: "content_paste",
37832
- action: async () => {
37833
- await actionGlobalPasteState(pinia);
37834
- api2.sendInspectorTree(INSPECTOR_ID);
37835
- api2.sendInspectorState(INSPECTOR_ID);
37836
- },
37837
- tooltip: "Replace the state with the content of your clipboard"
37838
- },
37839
- {
37840
- icon: "save",
37841
- action: () => {
37842
- actionGlobalSaveState(pinia);
37843
- },
37844
- tooltip: "Save the state as a JSON file"
37845
- },
37846
- {
37847
- icon: "folder_open",
37848
- action: async () => {
37849
- await actionGlobalOpenStateFile(pinia);
37850
- api2.sendInspectorTree(INSPECTOR_ID);
37851
- api2.sendInspectorState(INSPECTOR_ID);
37852
- },
37853
- tooltip: "Import the state from a JSON file"
37854
- }
37855
- ],
37856
- nodeActions: [
37857
- {
37858
- icon: "restore",
37859
- tooltip: "Reset the state (option store only)",
37860
- action: (nodeId) => {
37861
- const store = pinia._s.get(nodeId);
37862
- if (!store) {
37863
- toastMessage(`Cannot reset "${nodeId}" store because it wasn't found.`, "warn");
37864
- } else if (!store._isOptionsAPI) {
37865
- toastMessage(`Cannot reset "${nodeId}" store because it's a setup store.`, "warn");
37866
- } else {
37867
- store.$reset();
37868
- toastMessage(`Store "${nodeId}" reset.`);
37869
- }
37870
- }
37871
- }
37872
- ]
37873
- });
37874
- api2.on.inspectComponent((payload, ctx) => {
37875
- const proxy = payload.componentInstance && payload.componentInstance.proxy;
37876
- if (proxy && proxy._pStores) {
37877
- const piniaStores = payload.componentInstance.proxy._pStores;
37878
- Object.values(piniaStores).forEach((store) => {
37879
- payload.instanceData.state.push({
37880
- type: getStoreType(store.$id),
37881
- key: "state",
37882
- editable: true,
37883
- value: store._isOptionsAPI ? {
37884
- _custom: {
37885
- value: toRaw(store.$state),
37886
- actions: [
37887
- {
37888
- icon: "restore",
37889
- tooltip: "Reset the state of this store",
37890
- action: () => store.$reset()
37891
- }
37892
- ]
37893
- }
37894
- } : Object.keys(store.$state).reduce((state, key2) => {
37895
- state[key2] = store.$state[key2];
37896
- return state;
37897
- }, {})
37898
- });
37899
- if (store._getters && store._getters.length) {
37900
- payload.instanceData.state.push({
37901
- type: getStoreType(store.$id),
37902
- key: "getters",
37903
- editable: false,
37904
- value: store._getters.reduce((getters, key2) => {
37905
- try {
37906
- getters[key2] = store[key2];
37907
- } catch (error2) {
37908
- getters[key2] = error2;
37909
- }
37910
- return getters;
37911
- }, {})
37912
- });
37913
- }
37914
- });
37915
- }
37916
- });
37917
- api2.on.getInspectorTree((payload) => {
37918
- if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {
37919
- let stores = [pinia];
37920
- stores = stores.concat(Array.from(pinia._s.values()));
37921
- payload.rootNodes = (payload.filter ? stores.filter((store) => "$id" in store ? store.$id.toLowerCase().includes(payload.filter.toLowerCase()) : PINIA_ROOT_LABEL.toLowerCase().includes(payload.filter.toLowerCase())) : stores).map(formatStoreForInspectorTree);
37922
- }
37923
- });
37924
- api2.on.getInspectorState((payload) => {
37925
- if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {
37926
- const inspectedStore = payload.nodeId === PINIA_ROOT_ID ? pinia : pinia._s.get(payload.nodeId);
37927
- if (!inspectedStore) {
37928
- return;
37929
- }
37930
- if (inspectedStore) {
37931
- payload.state = formatStoreForInspectorState(inspectedStore);
37932
- }
37933
- }
37934
- });
37935
- api2.on.editInspectorState((payload, ctx) => {
37936
- if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {
37937
- const inspectedStore = payload.nodeId === PINIA_ROOT_ID ? pinia : pinia._s.get(payload.nodeId);
37938
- if (!inspectedStore) {
37939
- return toastMessage(`store "${payload.nodeId}" not found`, "error");
37940
- }
37941
- const { path } = payload;
37942
- if (!isPinia(inspectedStore)) {
37943
- if (path.length !== 1 || !inspectedStore._customProperties.has(path[0]) || path[0] in inspectedStore.$state) {
37944
- path.unshift("$state");
37945
- }
37946
- } else {
37947
- path.unshift("state");
37948
- }
37949
- isTimelineActive = false;
37950
- payload.set(inspectedStore, path, payload.state.value);
37951
- isTimelineActive = true;
37952
- }
37953
- });
37954
- api2.on.editComponentState((payload) => {
37955
- if (payload.type.startsWith("\u{1F34D}")) {
37956
- const storeId = payload.type.replace(/^🍍\s*/, "");
37957
- const store = pinia._s.get(storeId);
37958
- if (!store) {
37959
- return toastMessage(`store "${storeId}" not found`, "error");
37960
- }
37961
- const { path } = payload;
37962
- if (path[0] !== "state") {
37963
- return toastMessage(`Invalid path for store "${storeId}":
37964
- ${path}
37965
- Only state can be modified.`);
37966
- }
37967
- path[0] = "$state";
37968
- isTimelineActive = false;
37969
- payload.set(store, path, payload.state.value);
37970
- isTimelineActive = true;
37971
- }
37972
- });
37973
- });
37974
- }
37975
- function addStoreToDevtools(app, store) {
37976
- if (!componentStateTypes.includes(getStoreType(store.$id))) {
37977
- componentStateTypes.push(getStoreType(store.$id));
37978
- }
37979
- setupDevtoolsPlugin({
37980
- id: "dev.esm.pinia",
37981
- label: "Pinia \u{1F34D}",
37982
- logo: "https://pinia.vuejs.org/logo.svg",
37983
- packageName: "pinia",
37984
- homepage: "https://pinia.vuejs.org",
37985
- componentStateTypes,
37986
- app,
37987
- settings: {
37988
- logStoreChanges: {
37989
- label: "Notify about new/deleted stores",
37990
- type: "boolean",
37991
- defaultValue: true
37992
- }
37993
- }
37994
- }, (api2) => {
37995
- const now2 = typeof api2.now === "function" ? api2.now.bind(api2) : Date.now;
37996
- store.$onAction(({ after, onError, name: name2, args }) => {
37997
- const groupId = runningActionId++;
37998
- api2.addTimelineEvent({
37999
- layerId: MUTATIONS_LAYER_ID,
38000
- event: {
38001
- time: now2(),
38002
- title: "\u{1F6EB} " + name2,
38003
- subtitle: "start",
38004
- data: {
38005
- store: formatDisplay(store.$id),
38006
- action: formatDisplay(name2),
38007
- args
38008
- },
38009
- groupId
38010
- }
38011
- });
38012
- after((result2) => {
38013
- activeAction = void 0;
38014
- api2.addTimelineEvent({
38015
- layerId: MUTATIONS_LAYER_ID,
38016
- event: {
38017
- time: now2(),
38018
- title: "\u{1F6EC} " + name2,
38019
- subtitle: "end",
38020
- data: {
38021
- store: formatDisplay(store.$id),
38022
- action: formatDisplay(name2),
38023
- args,
38024
- result: result2
38025
- },
38026
- groupId
38027
- }
38028
- });
38029
- });
38030
- onError((error2) => {
38031
- activeAction = void 0;
38032
- api2.addTimelineEvent({
38033
- layerId: MUTATIONS_LAYER_ID,
38034
- event: {
38035
- time: now2(),
38036
- logType: "error",
38037
- title: "\u{1F4A5} " + name2,
38038
- subtitle: "end",
38039
- data: {
38040
- store: formatDisplay(store.$id),
38041
- action: formatDisplay(name2),
38042
- args,
38043
- error: error2
38044
- },
38045
- groupId
38046
- }
38047
- });
38048
- });
38049
- }, true);
38050
- store._customProperties.forEach((name2) => {
38051
- watch(() => unref(store[name2]), (newValue, oldValue) => {
38052
- api2.notifyComponentUpdate();
38053
- api2.sendInspectorState(INSPECTOR_ID);
38054
- if (isTimelineActive) {
38055
- api2.addTimelineEvent({
38056
- layerId: MUTATIONS_LAYER_ID,
38057
- event: {
38058
- time: now2(),
38059
- title: "Change",
38060
- subtitle: name2,
38061
- data: {
38062
- newValue,
38063
- oldValue
38064
- },
38065
- groupId: activeAction
38066
- }
38067
- });
38068
- }
38069
- }, { deep: true });
38070
- });
38071
- store.$subscribe(({ events, type }, state) => {
38072
- api2.notifyComponentUpdate();
38073
- api2.sendInspectorState(INSPECTOR_ID);
38074
- if (!isTimelineActive)
38075
- return;
38076
- const eventData = {
38077
- time: now2(),
38078
- title: formatMutationType(type),
38079
- data: __spreadValues({
38080
- store: formatDisplay(store.$id)
38081
- }, formatEventData(events)),
38082
- groupId: activeAction
38083
- };
38084
- activeAction = void 0;
38085
- if (type === MutationType.patchFunction) {
38086
- eventData.subtitle = "\u2935\uFE0F";
38087
- } else if (type === MutationType.patchObject) {
38088
- eventData.subtitle = "\u{1F9E9}";
38089
- } else if (events && !Array.isArray(events)) {
38090
- eventData.subtitle = events.type;
38091
- }
38092
- if (events) {
38093
- eventData.data["rawEvent(s)"] = {
38094
- _custom: {
38095
- display: "DebuggerEvent",
38096
- type: "object",
38097
- tooltip: "raw DebuggerEvent[]",
38098
- value: events
38099
- }
38100
- };
38101
- }
38102
- api2.addTimelineEvent({
38103
- layerId: MUTATIONS_LAYER_ID,
38104
- event: eventData
38105
- });
38106
- }, { detached: true, flush: "sync" });
38107
- const hotUpdate = store._hotUpdate;
38108
- store._hotUpdate = markRaw((newStore) => {
38109
- hotUpdate(newStore);
38110
- api2.addTimelineEvent({
38111
- layerId: MUTATIONS_LAYER_ID,
38112
- event: {
38113
- time: now2(),
38114
- title: "\u{1F525} " + store.$id,
38115
- subtitle: "HMR update",
38116
- data: {
38117
- store: formatDisplay(store.$id),
38118
- info: formatDisplay(`HMR update`)
38119
- }
38120
- }
38121
- });
38122
- api2.notifyComponentUpdate();
38123
- api2.sendInspectorTree(INSPECTOR_ID);
38124
- api2.sendInspectorState(INSPECTOR_ID);
38125
- });
38126
- const { $dispose } = store;
38127
- store.$dispose = () => {
38128
- $dispose();
38129
- api2.notifyComponentUpdate();
38130
- api2.sendInspectorTree(INSPECTOR_ID);
38131
- api2.sendInspectorState(INSPECTOR_ID);
38132
- api2.getSettings().logStoreChanges && toastMessage(`Disposed "${store.$id}" store \u{1F5D1}`);
38133
- };
38134
- api2.notifyComponentUpdate();
38135
- api2.sendInspectorTree(INSPECTOR_ID);
38136
- api2.sendInspectorState(INSPECTOR_ID);
38137
- api2.getSettings().logStoreChanges && toastMessage(`"${store.$id}" store installed \u{1F195}`);
38138
- });
38139
- }
38140
- let runningActionId = 0;
38141
- let activeAction;
38142
- function patchActionForGrouping(store, actionNames) {
38143
- const actions = actionNames.reduce((storeActions, actionName) => {
38144
- storeActions[actionName] = toRaw(store)[actionName];
38145
- return storeActions;
38146
- }, {});
38147
- for (const actionName in actions) {
38148
- store[actionName] = function() {
38149
- const _actionId = runningActionId;
38150
- const trackedStore = new Proxy(store, {
38151
- get(...args) {
38152
- activeAction = _actionId;
38153
- return Reflect.get(...args);
38154
- },
38155
- set(...args) {
38156
- activeAction = _actionId;
38157
- return Reflect.set(...args);
38158
- }
38159
- });
38160
- return actions[actionName].apply(trackedStore, arguments);
38161
- };
38162
- }
38163
- }
38164
- function devtoolsPlugin({ app, store, options }) {
38165
- if (store.$id.startsWith("__hot:")) {
38166
- return;
38167
- }
38168
- if (options.state) {
38169
- store._isOptionsAPI = true;
38170
- }
38171
- if (typeof options.state === "function") {
38172
- patchActionForGrouping(store, Object.keys(options.actions));
38173
- const originalHotUpdate = store._hotUpdate;
38174
- toRaw(store)._hotUpdate = function(newStore) {
38175
- originalHotUpdate.apply(this, arguments);
38176
- patchActionForGrouping(store, Object.keys(newStore._hmrPayload.actions));
38177
- };
38178
- }
38179
- addStoreToDevtools(app, store);
38180
- }
38181
37312
  function createPinia() {
38182
37313
  const scope = effectScope(true);
38183
37314
  const state = scope.run(() => ref({}));
@@ -38190,9 +37321,6 @@ function createPinia() {
38190
37321
  pinia._a = app;
38191
37322
  app.provide(piniaSymbol, pinia);
38192
37323
  app.config.globalProperties.$pinia = pinia;
38193
- if (IS_CLIENT) {
38194
- registerPiniaDevtools(app, pinia);
38195
- }
38196
37324
  toBeInstalled.forEach((plugin) => _p.push(plugin));
38197
37325
  toBeInstalled = [];
38198
37326
  }
@@ -38211,28 +37339,8 @@ function createPinia() {
38211
37339
  _s: new Map(),
38212
37340
  state
38213
37341
  });
38214
- if (IS_CLIENT && true && typeof Proxy !== "undefined") {
38215
- pinia.use(devtoolsPlugin);
38216
- }
38217
37342
  return pinia;
38218
37343
  }
38219
- function patchObject(newState, oldState) {
38220
- for (const key2 in oldState) {
38221
- const subPatch = oldState[key2];
38222
- if (!(key2 in newState)) {
38223
- continue;
38224
- }
38225
- const targetValue = newState[key2];
38226
- if (isPlainObject(targetValue) && isPlainObject(subPatch) && !isRef(subPatch) && !isReactive(subPatch)) {
38227
- newState[key2] = patchObject(targetValue, subPatch);
38228
- } else {
38229
- {
38230
- newState[key2] = subPatch;
38231
- }
38232
- }
38233
- }
38234
- return newState;
38235
- }
38236
37344
  const noop = () => {
38237
37345
  };
38238
37346
  function addSubscription(subscriptions, callback, detached, onCleanup = noop) {
@@ -38255,6 +37363,12 @@ function triggerSubscriptions(subscriptions, ...args) {
38255
37363
  });
38256
37364
  }
38257
37365
  function mergeReactiveObjects(target, patchToApply) {
37366
+ if (target instanceof Map && patchToApply instanceof Map) {
37367
+ patchToApply.forEach((value2, key2) => target.set(key2, value2));
37368
+ }
37369
+ if (target instanceof Set && patchToApply instanceof Set) {
37370
+ patchToApply.forEach(target.add, target);
37371
+ }
38258
37372
  for (const key2 in patchToApply) {
38259
37373
  if (!patchToApply.hasOwnProperty(key2))
38260
37374
  continue;
@@ -38268,7 +37382,7 @@ function mergeReactiveObjects(target, patchToApply) {
38268
37382
  }
38269
37383
  return target;
38270
37384
  }
38271
- const skipHydrateSymbol = Symbol("pinia:skipHydration");
37385
+ const skipHydrateSymbol = Symbol();
38272
37386
  function shouldHydrate(obj) {
38273
37387
  return !isPlainObject(obj) || !obj.hasOwnProperty(skipHydrateSymbol);
38274
37388
  }
@@ -38281,16 +37395,13 @@ function createOptionsStore(id, options, pinia, hot) {
38281
37395
  const initialState2 = pinia.state.value[id];
38282
37396
  let store;
38283
37397
  function setup() {
38284
- if (!initialState2 && !hot) {
37398
+ if (!initialState2 && true) {
38285
37399
  {
38286
37400
  pinia.state.value[id] = state ? state() : {};
38287
37401
  }
38288
37402
  }
38289
- const localState = hot ? toRefs(ref(state ? state() : {}).value) : toRefs(pinia.state.value[id]);
37403
+ const localState = toRefs(pinia.state.value[id]);
38290
37404
  return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name2) => {
38291
- if (name2 in localState) {
38292
- console.warn(`[\u{1F34D}]: A getter cannot have the same name as another state property. Rename one of them. Found with "${name2}" in store "${id}".`);
38293
- }
38294
37405
  computedGetters[name2] = markRaw(computed(() => {
38295
37406
  setActivePinia(pinia);
38296
37407
  const store2 = pinia._s.get(id);
@@ -38311,44 +37422,25 @@ function createOptionsStore(id, options, pinia, hot) {
38311
37422
  function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) {
38312
37423
  let scope;
38313
37424
  const optionsForPlugin = assign({ actions: {} }, options);
38314
- if (!pinia._e.active) {
38315
- throw new Error("Pinia destroyed");
38316
- }
38317
37425
  const $subscribeOptions = {
38318
37426
  deep: true
38319
37427
  };
38320
- {
38321
- $subscribeOptions.onTrigger = (event) => {
38322
- if (isListening) {
38323
- debuggerEvents = event;
38324
- } else if (isListening == false && !store._hotUpdating) {
38325
- if (Array.isArray(debuggerEvents)) {
38326
- debuggerEvents.push(event);
38327
- } else {
38328
- console.error("\u{1F34D} debuggerEvents should be an array. This is most likely an internal Pinia bug.");
38329
- }
38330
- }
38331
- };
38332
- }
38333
37428
  let isListening;
38334
37429
  let isSyncListening;
38335
37430
  let subscriptions = markRaw([]);
38336
37431
  let actionSubscriptions = markRaw([]);
38337
37432
  let debuggerEvents;
38338
37433
  const initialState2 = pinia.state.value[$id];
38339
- if (!isOptionsStore && !initialState2 && !hot) {
37434
+ if (!isOptionsStore && !initialState2 && true) {
38340
37435
  {
38341
37436
  pinia.state.value[$id] = {};
38342
37437
  }
38343
37438
  }
38344
- const hotState = ref({});
37439
+ ref({});
38345
37440
  let activeListener;
38346
37441
  function $patch(partialStateOrMutator) {
38347
37442
  let subscriptionMutation;
38348
37443
  isListening = isSyncListening = false;
38349
- {
38350
- debuggerEvents = [];
38351
- }
38352
37444
  if (typeof partialStateOrMutator === "function") {
38353
37445
  partialStateOrMutator(pinia.state.value[$id]);
38354
37446
  subscriptionMutation = {
@@ -38374,9 +37466,7 @@ function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore)
38374
37466
  isSyncListening = true;
38375
37467
  triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]);
38376
37468
  }
38377
- const $reset = () => {
38378
- throw new Error(`\u{1F34D}: Store "${$id}" is built using the setup syntax and does not implement $reset().`);
38379
- };
37469
+ const $reset = noop;
38380
37470
  function $dispose() {
38381
37471
  scope.stop();
38382
37472
  subscriptions = [];
@@ -38422,12 +37512,6 @@ function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore)
38422
37512
  return ret;
38423
37513
  };
38424
37514
  }
38425
- const _hmrPayload = /* @__PURE__ */ markRaw({
38426
- actions: {},
38427
- getters: {},
38428
- state: [],
38429
- hotState
38430
- });
38431
37515
  const partialStore = {
38432
37516
  _p: pinia,
38433
37517
  $id,
@@ -38449,10 +37533,7 @@ function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore)
38449
37533
  },
38450
37534
  $dispose
38451
37535
  };
38452
- const store = reactive(assign(IS_CLIENT ? {
38453
- _customProperties: markRaw(new Set()),
38454
- _hmrPayload
38455
- } : {}, partialStore));
37536
+ const store = reactive(assign({}, partialStore));
38456
37537
  pinia._s.set($id, store);
38457
37538
  const setupStore = pinia._e.run(() => {
38458
37539
  scope = effectScope();
@@ -38461,9 +37542,7 @@ function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore)
38461
37542
  for (const key2 in setupStore) {
38462
37543
  const prop = setupStore[key2];
38463
37544
  if (isRef(prop) && !isComputed(prop) || isReactive(prop)) {
38464
- if (hot) {
38465
- set(hotState.value, key2, toRef(setupStore, key2));
38466
- } else if (!isOptionsStore) {
37545
+ if (!isOptionsStore) {
38467
37546
  if (initialState2 && shouldHydrate(prop)) {
38468
37547
  if (isRef(prop)) {
38469
37548
  prop.value = initialState2[key2];
@@ -38475,120 +37554,29 @@ function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore)
38475
37554
  pinia.state.value[$id][key2] = prop;
38476
37555
  }
38477
37556
  }
38478
- {
38479
- _hmrPayload.state.push(key2);
38480
- }
38481
37557
  } else if (typeof prop === "function") {
38482
- const actionValue = hot ? prop : wrapAction(key2, prop);
37558
+ const actionValue = wrapAction(key2, prop);
38483
37559
  {
38484
37560
  setupStore[key2] = actionValue;
38485
37561
  }
38486
- {
38487
- _hmrPayload.actions[key2] = prop;
38488
- }
38489
37562
  optionsForPlugin.actions[key2] = prop;
38490
- } else {
38491
- if (isComputed(prop)) {
38492
- _hmrPayload.getters[key2] = isOptionsStore ? options.getters[key2] : prop;
38493
- if (IS_CLIENT) {
38494
- const getters = setupStore._getters || (setupStore._getters = markRaw([]));
38495
- getters.push(key2);
38496
- }
38497
- }
38498
- }
37563
+ } else
37564
+ ;
38499
37565
  }
38500
37566
  {
38501
37567
  assign(store, setupStore);
38502
37568
  assign(toRaw(store), setupStore);
38503
37569
  }
38504
37570
  Object.defineProperty(store, "$state", {
38505
- get: () => hot ? hotState.value : pinia.state.value[$id],
37571
+ get: () => pinia.state.value[$id],
38506
37572
  set: (state) => {
38507
- if (hot) {
38508
- throw new Error("cannot set hotState");
38509
- }
38510
37573
  $patch(($state) => {
38511
37574
  assign($state, state);
38512
37575
  });
38513
37576
  }
38514
37577
  });
38515
- {
38516
- store._hotUpdate = markRaw((newStore) => {
38517
- store._hotUpdating = true;
38518
- newStore._hmrPayload.state.forEach((stateKey) => {
38519
- if (stateKey in store.$state) {
38520
- const newStateTarget = newStore.$state[stateKey];
38521
- const oldStateSource = store.$state[stateKey];
38522
- if (typeof newStateTarget === "object" && isPlainObject(newStateTarget) && isPlainObject(oldStateSource)) {
38523
- patchObject(newStateTarget, oldStateSource);
38524
- } else {
38525
- newStore.$state[stateKey] = oldStateSource;
38526
- }
38527
- }
38528
- set(store, stateKey, toRef(newStore.$state, stateKey));
38529
- });
38530
- Object.keys(store.$state).forEach((stateKey) => {
38531
- if (!(stateKey in newStore.$state)) {
38532
- del(store, stateKey);
38533
- }
38534
- });
38535
- isListening = false;
38536
- isSyncListening = false;
38537
- pinia.state.value[$id] = toRef(newStore._hmrPayload, "hotState");
38538
- isSyncListening = true;
38539
- nextTick().then(() => {
38540
- isListening = true;
38541
- });
38542
- for (const actionName in newStore._hmrPayload.actions) {
38543
- const action = newStore[actionName];
38544
- set(store, actionName, wrapAction(actionName, action));
38545
- }
38546
- for (const getterName in newStore._hmrPayload.getters) {
38547
- const getter = newStore._hmrPayload.getters[getterName];
38548
- const getterValue = isOptionsStore ? computed(() => {
38549
- setActivePinia(pinia);
38550
- return getter.call(store, store);
38551
- }) : getter;
38552
- set(store, getterName, getterValue);
38553
- }
38554
- Object.keys(store._hmrPayload.getters).forEach((key2) => {
38555
- if (!(key2 in newStore._hmrPayload.getters)) {
38556
- del(store, key2);
38557
- }
38558
- });
38559
- Object.keys(store._hmrPayload.actions).forEach((key2) => {
38560
- if (!(key2 in newStore._hmrPayload.actions)) {
38561
- del(store, key2);
38562
- }
38563
- });
38564
- store._hmrPayload = newStore._hmrPayload;
38565
- store._getters = newStore._getters;
38566
- store._hotUpdating = false;
38567
- });
38568
- const nonEnumerable = {
38569
- writable: true,
38570
- configurable: true,
38571
- enumerable: false
38572
- };
38573
- if (IS_CLIENT) {
38574
- ["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((p2) => {
38575
- Object.defineProperty(store, p2, __spreadValues({
38576
- value: store[p2]
38577
- }, nonEnumerable));
38578
- });
38579
- }
38580
- }
38581
37578
  pinia._p.forEach((extender) => {
38582
- if (IS_CLIENT) {
38583
- const extensions = scope.run(() => extender({
38584
- store,
38585
- app: pinia._a,
38586
- pinia,
38587
- options: optionsForPlugin
38588
- }));
38589
- Object.keys(extensions || {}).forEach((key2) => store._customProperties.add(key2));
38590
- assign(store, extensions);
38591
- } else {
37579
+ {
38592
37580
  assign(store, scope.run(() => extender({
38593
37581
  store,
38594
37582
  app: pinia._a,
@@ -38597,11 +37585,6 @@ function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore)
38597
37585
  })));
38598
37586
  }
38599
37587
  });
38600
- if (store.$state && typeof store.$state === "object" && typeof store.$state.constructor === "function" && !store.$state.constructor.toString().includes("[native code]")) {
38601
- console.warn(`[\u{1F34D}]: The "state" must be a plain object. It cannot be
38602
- state: () => new MyClass()
38603
- Found in store "${store.$id}".`);
38604
- }
38605
37588
  if (initialState2 && isOptionsStore && options.hydrate) {
38606
37589
  options.hydrate(store.$state, initialState2);
38607
37590
  }
@@ -38625,12 +37608,6 @@ function defineStore(idOrOptions, setup, setupOptions) {
38625
37608
  pinia = pinia || currentInstance2 && inject(piniaSymbol);
38626
37609
  if (pinia)
38627
37610
  setActivePinia(pinia);
38628
- if (!activePinia) {
38629
- throw new Error(`[\u{1F34D}]: getActivePinia was called with no active Pinia. Did you forget to install pinia?
38630
- const pinia = createPinia()
38631
- app.use(pinia)
38632
- This will fail in production.`);
38633
- }
38634
37611
  pinia = activePinia;
38635
37612
  if (!pinia._s.has(id)) {
38636
37613
  if (isSetupStore) {
@@ -38638,23 +37615,8 @@ This will fail in production.`);
38638
37615
  } else {
38639
37616
  createOptionsStore(id, options, pinia);
38640
37617
  }
38641
- {
38642
- useStore._pinia = pinia;
38643
- }
38644
37618
  }
38645
37619
  const store = pinia._s.get(id);
38646
- if (hot) {
38647
- const hotId = "__hot:" + id;
38648
- const newStore = isSetupStore ? createSetupStore(hotId, setup, options, pinia, true) : createOptionsStore(hotId, assign({}, options), pinia, true);
38649
- hot._hotUpdate(newStore);
38650
- delete pinia.state.value[hotId];
38651
- pinia._s.delete(hotId);
38652
- }
38653
- if (IS_CLIENT && currentInstance2 && currentInstance2.proxy && !hot) {
38654
- const vm = currentInstance2.proxy;
38655
- const cache = "_pStores" in vm ? vm._pStores : vm._pStores = {};
38656
- cache[id] = store;
38657
- }
38658
37620
  return store;
38659
37621
  }
38660
37622
  useStore.$id = id;
@@ -40629,9 +39591,9 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
40629
39591
  var GetBankInfoWrapper = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$e]]);
40630
39592
  function getBankInfo(params) {
40631
39593
  const newParams = reconstructParams(params);
40632
- execute(newParams);
39594
+ execute$1(newParams);
40633
39595
  }
40634
- function execute(params) {
39596
+ function execute$1(params) {
40635
39597
  var _a;
40636
39598
  try {
40637
39599
  const container2 = document.createElement("div");
@@ -42353,6 +41315,42 @@ function registerPaymentFeatures(params) {
42353
41315
  app.mount(container2);
42354
41316
  document.body.appendChild(container2);
42355
41317
  }
41318
+ async function getCashbackInformation(params) {
41319
+ const newParams = reconstructParams(params);
41320
+ await execute(newParams);
41321
+ }
41322
+ async function execute(params) {
41323
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
41324
+ try {
41325
+ if (!(params == null ? void 0 : params.merchantPaymentId)) {
41326
+ return (_a = params == null ? void 0 : params.fail) == null ? void 0 : _a.call(params, { errorCode: MiniAppErrorType.badRequest });
41327
+ }
41328
+ const grantStatus = await checkPermission(PermissionName.mini_app_cashback_information);
41329
+ if (grantStatus !== PermissionStatus.granted) {
41330
+ return (_b = params == null ? void 0 : params.fail) == null ? void 0 : _b.call(params, {
41331
+ errorCode: MiniAppErrorType.insufficientScope
41332
+ });
41333
+ }
41334
+ const res = await ppFetch2({
41335
+ method: "GET",
41336
+ url: `web-api/app/v1/payments/cashback/granted/${params.merchantPaymentId}`,
41337
+ params: { merchant: params == null ? void 0 : params.merchant }
41338
+ });
41339
+ if ((res == null ? void 0 : res.ppFetchResult) === "apiError" && ((_e = (_d = (_c = res == null ? void 0 : res.body) == null ? void 0 : _c.unsigned) == null ? void 0 : _d.resultInfo) == null ? void 0 : _e.code) === "RESOURCE_NOT_FOUND") {
41340
+ return (_f = params == null ? void 0 : params.fail) == null ? void 0 : _f.call(params, {
41341
+ errorCode: MiniAppErrorType.invalidPaymentIdentifier
41342
+ });
41343
+ } else if (res.ppFetchResult !== "success") {
41344
+ return (_g = params == null ? void 0 : params.fail) == null ? void 0 : _g.call(params, { errorCode: getFailErrorCode(res.ppFetchResult) });
41345
+ } else {
41346
+ return (_j = params == null ? void 0 : params.success) == null ? void 0 : _j.call(params, {
41347
+ jws: (_i = (_h = res == null ? void 0 : res.body) == null ? void 0 : _h.signed) == null ? void 0 : _i.jws
41348
+ });
41349
+ }
41350
+ } catch (e) {
41351
+ return (_k = params == null ? void 0 : params.fail) == null ? void 0 : _k.call(params, { errorCode: MiniAppErrorType.serverError });
41352
+ }
41353
+ }
42356
41354
  var RuntimeEnv;
42357
41355
  (function(RuntimeEnv2) {
42358
41356
  RuntimeEnv2["JS"] = "JS";
@@ -42373,6 +41371,10 @@ class MiniAppModule extends JsBridgeModule {
42373
41371
  copyToClipboard(params) {
42374
41372
  copyToClipboard(params);
42375
41373
  }
41374
+ getCashbackInformation(params) {
41375
+ getCashbackInformation(params).catch(() => {
41376
+ });
41377
+ }
42376
41378
  openWebview(params) {
42377
41379
  openWebview(params);
42378
41380
  }