@obb871001/api-integration-sdk 1.0.337 → 1.0.339

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import de, { createContext as qt, useContext as ci, useState as oi, useMemo as Oa, useCallback as I, useRef as ee, useEffect as ge } from "react";
1
+ import de, { createContext as qt, useContext as ci, useState as oi, useMemo as Oa, useCallback as I, useRef as ee, useEffect as pe } from "react";
2
2
  import { useQueries as Wn, useQuery as j, useQueryClient as fi, useMutation as le, QueryClient as Ol, QueryClientProvider as Bl } from "@tanstack/react-query";
3
3
  import Hl from "axios";
4
4
  import { get as re, find as $e, isEmpty as Ee, entries as zn, forEach as Wl, map as Be, isArray as la, toLower as Di, omit as zl, replace as at, includes as Il, isObject as $t, flatMap as Qt, values as Vl, keys as Ei } from "lodash";
@@ -69,10 +69,10 @@ function ql() {
69
69
  {
70
70
  var $ = y.ReactDebugCurrentFrame, ue = $.getStackAddendum();
71
71
  ue !== "" && (z += "%s", J = J.concat([ue]));
72
- var pe = J.map(function(ne) {
72
+ var ge = J.map(function(ne) {
73
73
  return String(ne);
74
74
  });
75
- pe.unshift("Warning: " + z), Function.prototype.apply.call(console[T], console, pe);
75
+ ge.unshift("Warning: " + z), Function.prototype.apply.call(console[T], console, ge);
76
76
  }
77
77
  }
78
78
  var C = !1, v = !1, D = !1, E = !1, G = !1, O;
@@ -129,9 +129,9 @@ function ql() {
129
129
  var $ = T.displayName || null;
130
130
  return $ !== null ? $ : A(T.type) || "Memo";
131
131
  case m: {
132
- var ue = T, pe = ue._payload, ne = ue._init;
132
+ var ue = T, ge = ue._payload, ne = ue._init;
133
133
  try {
134
- return A(ne(pe));
134
+ return A(ne(ge));
135
135
  } catch {
136
136
  return null;
137
137
  }
@@ -232,8 +232,8 @@ function ql() {
232
232
  ae = !0;
233
233
  var ue = Error.prepareStackTrace;
234
234
  Error.prepareStackTrace = void 0;
235
- var pe;
236
- pe = q.current, q.current = null, N();
235
+ var ge;
236
+ ge = q.current, q.current = null, N();
237
237
  try {
238
238
  if (z) {
239
239
  var ne = function() {
@@ -286,7 +286,7 @@ function ql() {
286
286
  }
287
287
  }
288
288
  } finally {
289
- ae = !1, q.current = pe, Z(), Error.prepareStackTrace = ue;
289
+ ae = !1, q.current = ge, Z(), Error.prepareStackTrace = ue;
290
290
  }
291
291
  var Ra = T ? T.displayName || T.name : "", ba = Ra ? K(Ra) : "";
292
292
  return typeof T == "function" && ie.set(T, ba), ba;
@@ -318,9 +318,9 @@ function ql() {
318
318
  case o:
319
319
  return ke(T.type, z, J);
320
320
  case m: {
321
- var $ = T, ue = $._payload, pe = $._init;
321
+ var $ = T, ue = $._payload, ge = $._init;
322
322
  try {
323
- return ke(pe(ue), z, J);
323
+ return ke(ge(ue), z, J);
324
324
  } catch {
325
325
  }
326
326
  }
@@ -337,9 +337,9 @@ function ql() {
337
337
  }
338
338
  function ea(T, z, J, $, ue) {
339
339
  {
340
- var pe = Function.call.bind(fe);
340
+ var ge = Function.call.bind(fe);
341
341
  for (var ne in T)
342
- if (pe(T, ne)) {
342
+ if (ge(T, ne)) {
343
343
  var X = void 0;
344
344
  try {
345
345
  if (typeof T[ne] != "function") {
@@ -425,7 +425,7 @@ function ql() {
425
425
  });
426
426
  }
427
427
  }
428
- var Va = function(T, z, J, $, ue, pe, ne) {
428
+ var Va = function(T, z, J, $, ue, ge, ne) {
429
429
  var X = {
430
430
  // This tag allows us to uniquely identify this as a React Element
431
431
  $$typeof: n,
@@ -435,7 +435,7 @@ function ql() {
435
435
  ref: J,
436
436
  props: ne,
437
437
  // Record the component responsible for creating this element.
438
- _owner: pe
438
+ _owner: ge
439
439
  };
440
440
  return X._store = {}, Object.defineProperty(X._store, "validated", {
441
441
  configurable: !1,
@@ -456,14 +456,14 @@ function ql() {
456
456
  };
457
457
  function Ja(T, z, J, $, ue) {
458
458
  {
459
- var pe, ne = {}, X = null, Oe = null;
459
+ var ge, ne = {}, X = null, Oe = null;
460
460
  J !== void 0 && (xe(J), X = "" + J), Ye(z) && (xe(z.key), X = "" + z.key), Ve(z) && (Oe = z.ref, Ia(z, ue));
461
- for (pe in z)
462
- fe.call(z, pe) && !je.hasOwnProperty(pe) && (ne[pe] = z[pe]);
461
+ for (ge in z)
462
+ fe.call(z, ge) && !je.hasOwnProperty(ge) && (ne[ge] = z[ge]);
463
463
  if (T && T.defaultProps) {
464
464
  var be = T.defaultProps;
465
- for (pe in be)
466
- ne[pe] === void 0 && (ne[pe] = be[pe]);
465
+ for (ge in be)
466
+ ne[ge] === void 0 && (ne[ge] = be[ge]);
467
467
  }
468
468
  if (X || Oe) {
469
469
  var he = typeof T == "function" ? T.displayName || T.name || "Unknown" : T;
@@ -540,7 +540,7 @@ Check the top-level render call using <` + J + ">.");
540
540
  else if (T) {
541
541
  var ue = f(T);
542
542
  if (typeof ue == "function" && ue !== T.entries)
543
- for (var pe = ue.call(T), ne; !(ne = pe.next()).done; )
543
+ for (var ge = ue.call(T), ne; !(ne = ge.next()).done; )
544
544
  fa(ne.value) && Ma(ne.value, z);
545
545
  }
546
546
  }
@@ -583,7 +583,7 @@ Check the top-level render call using <` + J + ">.");
583
583
  }
584
584
  }
585
585
  var ia = {};
586
- function Pe(T, z, J, $, ue, pe) {
586
+ function Pe(T, z, J, $, ue, ge) {
587
587
  {
588
588
  var ne = k(T);
589
589
  if (!ne) {
@@ -594,7 +594,7 @@ Check the top-level render call using <` + J + ">.");
594
594
  var be;
595
595
  T === null ? be = "null" : ve(T) ? be = "array" : T !== void 0 && T.$$typeof === n ? (be = "<" + (A(T.type) || "Unknown") + " />", X = " Did you accidentally export a JSX literal instead of a component?") : be = typeof T, _("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", be, X);
596
596
  }
597
- var he = Ja(T, z, J, ue, pe);
597
+ var he = Ja(T, z, J, ue, ge);
598
598
  if (he == null)
599
599
  return he;
600
600
  if (ne) {
@@ -7394,14 +7394,14 @@ const No = /* @__PURE__ */ _i(Eo), Lo = ({
7394
7394
  const { code: c, request_id: f } = s;
7395
7395
  switch (c) {
7396
7396
  case 200:
7397
- r(), g.dispatch({
7397
+ g.dispatch({
7398
7398
  type: "ui/showToast",
7399
7399
  payload: {
7400
7400
  title: Ba[o] || "System Prompt",
7401
7401
  description: "點數轉入成功,請確認遊戲餘額",
7402
7402
  status: "success"
7403
7403
  }
7404
- });
7404
+ }), r();
7405
7405
  return;
7406
7406
  case 101:
7407
7407
  localStorage.setItem("transfer_in_game_request_id", f), i();
@@ -7817,7 +7817,7 @@ const No = /* @__PURE__ */ _i(Eo), Lo = ({
7817
7817
  return null;
7818
7818
  }
7819
7819
  }, [O]);
7820
- ge(() => {
7820
+ pe(() => {
7821
7821
  const w = setInterval(
7822
7822
  () => E("ping"),
7823
7823
  Jo
@@ -7838,11 +7838,11 @@ const No = /* @__PURE__ */ _i(Eo), Lo = ({
7838
7838
  },
7839
7839
  [g, d, s]
7840
7840
  );
7841
- ge(() => {
7841
+ pe(() => {
7842
7842
  f.current = n;
7843
7843
  }, [n]);
7844
7844
  const A = ee(null);
7845
- return ge(() => {
7845
+ return pe(() => {
7846
7846
  if (!h || A.current === h)
7847
7847
  return;
7848
7848
  A.current = h;
@@ -7910,14 +7910,14 @@ const No = /* @__PURE__ */ _i(Eo), Lo = ({
7910
7910
  D();
7911
7911
  return;
7912
7912
  }
7913
- localStorage.removeItem("transfer_in_game_request_id"), o(), d.dispatch({
7913
+ localStorage.removeItem("transfer_in_game_request_id"), d.dispatch({
7914
7914
  type: "ui/showToast",
7915
7915
  payload: {
7916
7916
  title: Ba[s] || "System Prompt",
7917
7917
  description: `您於${ke}存入的${ce}元已經處理完成了,請確認遊戲餘額`,
7918
7918
  status: "success"
7919
7919
  }
7920
- });
7920
+ }), o();
7921
7921
  }
7922
7922
  M?.(N);
7923
7923
  }
@@ -7962,7 +7962,11 @@ const No = /* @__PURE__ */ _i(Eo), Lo = ({
7962
7962
  o,
7963
7963
  _,
7964
7964
  C
7965
- ]), ge(() => () => c.current = !0, []), ge(() => {
7965
+ ]), pe(() => () => c.current = !0, []), pe(() => {
7966
+ localStorage.getItem(
7967
+ "transfer_in_game_request_id"
7968
+ ) && u();
7969
+ }, [u]), pe(() => {
7966
7970
  if (U) {
7967
7971
  const w = localStorage.getItem(
7968
7972
  "transfer_in_game_request_id"
@@ -7973,14 +7977,14 @@ const No = /* @__PURE__ */ _i(Eo), Lo = ({
7973
7977
  member_info_uid: y
7974
7978
  });
7975
7979
  }
7976
- }, [y, m, G, U]), ge(() => {
7980
+ }, [y, m, G, U]), pe(() => {
7977
7981
  m ? d.dispatch({
7978
7982
  type: "ui/showToast",
7979
7983
  payload: {
7980
7984
  title: Ba[s] || "System Prompt",
7981
7985
  description: jl[s] || "We are processing your transfer",
7982
7986
  status: "warning",
7983
- duration: 999999,
7987
+ duration: 1 / 0,
7984
7988
  id: "trasnferingInGame"
7985
7989
  }
7986
7990
  }) : i && d.dispatch({
@@ -8586,7 +8590,7 @@ function ds({ timeout: e = 1e3 * 60 * 20, promptTimeout: n = 0, promptBeforeIdle
8586
8590
  }, onMessage: m = () => {
8587
8591
  }, debounce: u = 0, throttle: s = 0, eventsThrottle: c = 200, startOnMount: f = !0, startManually: y = !1, stopOnIdle: _ = !1, crossTab: U = !1, name: C = "idle-timer", syncTimers: v = 0, leaderElection: D = !1, disabled: E = !1 } = {}) {
8588
8592
  let G = ee(Te()), O = ee(Te()), k = ee(null), h = ee(null), F = ee(0), A = ee(0), w = ee(0), R = ee(0), P = ee(!1), H = ee(!1), B = ee(!1), W = ee(!0), M = ee(!1), S = ee(null), x = ee(null), L = ee(e), N = ee(0);
8589
- ge(() => {
8593
+ pe(() => {
8590
8594
  if (n && console.warn("⚠️ IdleTimer -- The `promptTimeout` property has been deprecated in favor of `promptBeforeIdle`. It will be removed in the next major release."), t && n) throw new Error("❌ Both promptTimeout and promptBeforeIdle can not be set. The promptTimeout property will be deprecated in a future version.");
8591
8595
  if (e >= Fa) throw new Error(`❌ The value for the timeout property must fit in a 32 bit signed integer, ${Fa}.`);
8592
8596
  if (n >= Fa) throw new Error(`❌ The value for the promptTimeout property must fit in a 32 bit signed integer, ${Fa}.`);
@@ -8598,42 +8602,42 @@ function ds({ timeout: e = 1e3 * 60 * 20, promptTimeout: n = 0, promptBeforeIdle
8598
8602
  }
8599
8603
  }, [e, n, t, y, E]);
8600
8604
  let Z = ee(_);
8601
- ge(() => {
8605
+ pe(() => {
8602
8606
  Z.current = _;
8603
8607
  }, [_]);
8604
8608
  let q = ee(b), Q = ee(l), K = ee([...(/* @__PURE__ */ new Set([...p, ...b])).values()]), ae = ee(E);
8605
- ge(() => {
8609
+ pe(() => {
8606
8610
  ae.current = E, !W.current && (E ? Ve() : y || je());
8607
8611
  }, [E]);
8608
8612
  let ie = ee(d);
8609
- ge(() => {
8613
+ pe(() => {
8610
8614
  ie.current = d;
8611
8615
  }, [d]);
8612
8616
  let ye = ee(r);
8613
- ge(() => {
8617
+ pe(() => {
8614
8618
  ye.current = r;
8615
8619
  }, [r]);
8616
8620
  let Ue = ee(a);
8617
- ge(() => {
8621
+ pe(() => {
8618
8622
  Ue.current = a;
8619
8623
  }, [a]);
8620
8624
  let me = ee(i);
8621
- ge(() => {
8625
+ pe(() => {
8622
8626
  me.current = i;
8623
8627
  }, [i]);
8624
8628
  let ce = ee(o);
8625
- ge(() => {
8629
+ pe(() => {
8626
8630
  ce.current = o;
8627
8631
  }, [o]);
8628
8632
  let ke = ee(m);
8629
- ge(() => {
8633
+ pe(() => {
8630
8634
  ke.current = m;
8631
8635
  }, [m]);
8632
8636
  let fe = Oa(() => {
8633
8637
  let V = (De, ia) => ce.current(De, ia);
8634
8638
  return u > 0 ? gs(V, u) : s > 0 ? ri(V, s) : V;
8635
8639
  }, [s, u]), Ie = ee();
8636
- ge(() => {
8640
+ pe(() => {
8637
8641
  U && v && (Ie.current = ri(() => {
8638
8642
  x.current.active();
8639
8643
  }, v));
@@ -8673,7 +8677,7 @@ function ds({ timeout: e = 1e3 * 60 * 20, promptTimeout: n = 0, promptBeforeIdle
8673
8677
  }
8674
8678
  B.current = !1, R.current = 0, w.current = 0, Ge(), U && v && Ie.current();
8675
8679
  }, ta = ee(aa);
8676
- ge(() => {
8680
+ pe(() => {
8677
8681
  let V = M.current;
8678
8682
  V && Re(), c > 0 ? ta.current = ri(aa, c) : ta.current = aa, V && xe();
8679
8683
  }, [c, s, u, ce, U, v]);
@@ -8696,7 +8700,7 @@ function ds({ timeout: e = 1e3 * 60 * 20, promptTimeout: n = 0, promptBeforeIdle
8696
8700
  let V = Math.round(ca() - Ua());
8697
8701
  return V >= 0 ? V : 0;
8698
8702
  }, [k, F]);
8699
- ge(() => {
8703
+ pe(() => {
8700
8704
  if (u > 0 && s > 0) throw new Error("❌ onAction can either be throttled or debounced, not both.");
8701
8705
  g && ns(g);
8702
8706
  let V = () => {
@@ -8705,7 +8709,7 @@ function ds({ timeout: e = 1e3 * 60 * 20, promptTimeout: n = 0, promptBeforeIdle
8705
8709
  return pa && window.addEventListener("beforeunload", V), () => {
8706
8710
  pa && window.removeEventListener("beforeunload", V), x.current && x.current.close(), fe.cancel && fe.cancel(), Ce(), Re(!0);
8707
8711
  };
8708
- }, []), ge(() => {
8712
+ }, []), pe(() => {
8709
8713
  x.current && x.current.close(), U ? x.current = new ms({ channelName: C, leaderElection: D, onPrompt: () => {
8710
8714
  ea();
8711
8715
  }, onIdle: () => {
@@ -8715,15 +8719,15 @@ function ds({ timeout: e = 1e3 * 60 * 20, promptTimeout: n = 0, promptBeforeIdle
8715
8719
  }, onMessage: (V) => {
8716
8720
  ke.current(V, Se);
8717
8721
  }, start: je, reset: oa, activate: ga, pause: Ve, resume: Ye }) : x.current = null;
8718
- }, [U, C, D, ye, Ue, me, ke, je, oa, Ve, Ye]), ge(() => {
8722
+ }, [U, C, D, ye, Ue, me, ke, je, oa, Ve, Ye]), pe(() => {
8719
8723
  W.current || (Ce(), Re(!0)), !(y || E) && (f ? je() : xe());
8720
- }, [y, f, E, W]), ge(() => {
8724
+ }, [y, f, E, W]), pe(() => {
8721
8725
  if (!W.current) {
8722
8726
  let V = [...(/* @__PURE__ */ new Set([...p, ...b])).values()];
8723
8727
  if (Re(), K.current = V, Q.current = l, q.current = b, y || E) return;
8724
8728
  f ? je() : xe();
8725
8729
  }
8726
- }, [l, JSON.stringify(p), JSON.stringify(b), W, E, y, f]), ge(() => {
8730
+ }, [l, JSON.stringify(p), JSON.stringify(b), W, E, y, f]), pe(() => {
8727
8731
  W.current && (W.current = !1);
8728
8732
  }, [W]);
8729
8733
  let Se = { message: Ia, start: je, reset: oa, activate: ga, pause: Ve, resume: Ye, isIdle: Da, isPrompted: Ea, isLeader: Va, isLastActiveTab: Ja, getTabId: da, getRemainingTime: ya, getElapsedTime: Ke, getTotalElapsedTime: ca, getLastIdleTime: fa, getLastActiveTime: Na, getIdleTime: La, getTotalIdleTime: Ua, getActiveTime: Ga, getTotalActiveTime: Ma, setOnPresenceChange: (V) => {
@@ -36473,7 +36477,7 @@ const jm = ({ onIdle: e, onActive: n, onAction: t, timeout: l = 6e5 }) => ds({
36473
36477
  autoFetch: n = !1,
36474
36478
  mockData: t = !1
36475
36479
  }) => {
36476
- ge(() => {
36480
+ pe(() => {
36477
36481
  t && im(!0);
36478
36482
  }, [t]);
36479
36483
  const l = tm({ enabled: n });
@@ -36519,7 +36523,7 @@ const hu = ({ onFunction: e = () => {
36519
36523
  retry: !1
36520
36524
  }
36521
36525
  });
36522
- ge(() => {
36526
+ pe(() => {
36523
36527
  l.current || b === "true" && r && a && (o({
36524
36528
  trans_code: d,
36525
36529
  line_id: r,
@@ -37425,9 +37429,9 @@ const cm = {
37425
37429
  enabled: e ? !0 : !!c && !u
37426
37430
  }
37427
37431
  }), _ = re(f, "liff_url", "") || `https://liff.line.me/${o}`;
37428
- ge(() => {
37432
+ pe(() => {
37429
37433
  c && mi.set("machine_mac_address", c, { expires: 365 });
37430
- }, [c]), ge(() => (_ && (d(300), a(!1), i.current && clearInterval(i.current), i.current = setInterval(() => {
37434
+ }, [c]), pe(() => (_ && (d(300), a(!1), i.current && clearInterval(i.current), i.current = setInterval(() => {
37431
37435
  d((v) => v <= 1 ? (clearInterval(i.current), a(!0), 0) : v - 1);
37432
37436
  }, 1e3)), () => {
37433
37437
  i.current && clearInterval(i.current);
@@ -37497,7 +37501,7 @@ const cm = {
37497
37501
  }
37498
37502
  }
37499
37503
  }), b = ee(!1);
37500
- return ge(() => {
37504
+ return pe(() => {
37501
37505
  if (b.current) return;
37502
37506
  const d = new URLSearchParams(window.location.search), r = d.get("bind_type"), a = d.get("bind_id");
37503
37507
  if (r && a)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@obb871001/api-integration-sdk",
3
3
  "private": false,
4
- "version": "1.0.337",
4
+ "version": "1.0.339",
5
5
  "description": "集成API",
6
6
  "main": "dist/index.cjs",
7
7
  "module": "dist/index.js",