zyjj-web-sdk 1.1.26 → 1.1.27

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/lib/index.js CHANGED
@@ -15,11 +15,11 @@ const { toString: Lo } = Object.prototype, { getPrototypeOf: wr } = Object, mt =
15
15
  const r = Lo.call(t);
16
16
  return e[r] || (e[r] = r.slice(8, -1).toLowerCase());
17
17
  })(/* @__PURE__ */ Object.create(null)), Ee = (e) => (e = e.toLowerCase(), (t) => mt(t) === e), yt = (e) => (t) => typeof t === e, { isArray: Ve } = Array, Je = yt("undefined");
18
- function To(e) {
18
+ function Wo(e) {
19
19
  return e !== null && !Je(e) && e.constructor !== null && !Je(e.constructor) && de(e.constructor.isBuffer) && e.constructor.isBuffer(e);
20
20
  }
21
21
  const _n = Ee("ArrayBuffer");
22
- function Wo(e) {
22
+ function To(e) {
23
23
  let t;
24
24
  return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && _n(e.buffer), t;
25
25
  }
@@ -176,9 +176,9 @@ const Es = (e) => {
176
176
  }, Ss = Ee("AsyncFunction"), _s = (e) => e && (gt(e) || de(e)) && de(e.then) && de(e.catch), h = {
177
177
  isArray: Ve,
178
178
  isArrayBuffer: _n,
179
- isBuffer: To,
179
+ isBuffer: Wo,
180
180
  isFormData: Qo,
181
- isArrayBufferView: Wo,
181
+ isArrayBufferView: To,
182
182
  isString: Ho,
183
183
  isNumber: On,
184
184
  isBoolean: Go,
@@ -284,7 +284,7 @@ function qt(e) {
284
284
  function Nn(e) {
285
285
  return h.endsWith(e, "[]") ? e.slice(0, -2) : e;
286
286
  }
287
- function Tr(e, t, r) {
287
+ function Wr(e, t, r) {
288
288
  return e ? e.concat(t).map(function(o, s) {
289
289
  return o = Nn(o), !r && s ? "[" + o + "]" : o;
290
290
  }).join(r ? "." : "") : t;
@@ -325,12 +325,12 @@ function bt(e, t, r) {
325
325
  return b = Nn(b), M.forEach(function(x, I) {
326
326
  !(h.isUndefined(x) || x === null) && t.append(
327
327
  // eslint-disable-next-line no-nested-ternary
328
- i === !0 ? Tr([b], I, s) : i === null ? b : b + "[]",
328
+ i === !0 ? Wr([b], I, s) : i === null ? b : b + "[]",
329
329
  d(x)
330
330
  );
331
331
  }), !1;
332
332
  }
333
- return qt(m) ? !0 : (t.append(Tr(N, b, s), d(m)), !1);
333
+ return qt(m) ? !0 : (t.append(Wr(N, b, s), d(m)), !1);
334
334
  }
335
335
  const l = [], S = Object.assign(Rs, {
336
336
  defaultVisitor: f,
@@ -356,7 +356,7 @@ function bt(e, t, r) {
356
356
  throw new TypeError("data must be an object");
357
357
  return v(e), t;
358
358
  }
359
- function Wr(e) {
359
+ function Tr(e) {
360
360
  const t = {
361
361
  "!": "%21",
362
362
  "'": "%27",
@@ -379,8 +379,8 @@ kn.append = function(t, r) {
379
379
  };
380
380
  kn.toString = function(t) {
381
381
  const r = t ? function(n) {
382
- return t.call(this, n, Wr);
383
- } : Wr;
382
+ return t.call(this, n, Tr);
383
+ } : Tr;
384
384
  return this._pairs.map(function(o) {
385
385
  return r(o[0]) + "=" + r(o[1]);
386
386
  }, "").join("&");
@@ -612,7 +612,7 @@ const Us = h.toObjectSet([
612
612
  o = i.indexOf(":"), r = i.substring(0, o).trim().toLowerCase(), n = i.substring(o + 1).trim(), !(!r || t[r] && Us[r]) && (r === "set-cookie" ? t[r] ? t[r].push(n) : t[r] = [n] : t[r] = t[r] ? t[r] + ", " + n : n);
613
613
  }), t;
614
614
  }, Gr = Symbol("internals");
615
- function We(e) {
615
+ function Te(e) {
616
616
  return e && String(e).trim().toLowerCase();
617
617
  }
618
618
  function ft(e) {
@@ -657,7 +657,7 @@ class he {
657
657
  set(t, r, n) {
658
658
  const o = this;
659
659
  function s(c, u, d) {
660
- const f = We(u);
660
+ const f = Te(u);
661
661
  if (!f)
662
662
  throw new Error("header name must be a non-empty string");
663
663
  const l = h.findKey(o, f);
@@ -667,7 +667,7 @@ class he {
667
667
  return h.isPlainObject(t) || t instanceof this.constructor ? i(t, r) : h.isString(t) && (t = t.trim()) && !qs(t) ? i(Bs(t), r) : t != null && s(r, t, n), this;
668
668
  }
669
669
  get(t, r) {
670
- if (t = We(t), t) {
670
+ if (t = Te(t), t) {
671
671
  const n = h.findKey(this, t);
672
672
  if (n) {
673
673
  const o = this[n];
@@ -684,7 +684,7 @@ class he {
684
684
  }
685
685
  }
686
686
  has(t, r) {
687
- if (t = We(t), t) {
687
+ if (t = Te(t), t) {
688
688
  const n = h.findKey(this, t);
689
689
  return !!(n && this[n] !== void 0 && (!r || Nt(this, this[n], n, r)));
690
690
  }
@@ -694,7 +694,7 @@ class he {
694
694
  const n = this;
695
695
  let o = !1;
696
696
  function s(i) {
697
- if (i = We(i), i) {
697
+ if (i = Te(i), i) {
698
698
  const c = h.findKey(n, i);
699
699
  c && (!r || Nt(n, n[c], c, r)) && (delete n[c], o = !0);
700
700
  }
@@ -753,7 +753,7 @@ class he {
753
753
  accessors: {}
754
754
  }).accessors, o = this.prototype;
755
755
  function s(i) {
756
- const c = We(i);
756
+ const c = Te(i);
757
757
  n[c] || (Ls(o, i), n[c] = !0);
758
758
  }
759
759
  return h.isArray(t) ? t.forEach(s) : s(t), this;
@@ -786,7 +786,7 @@ function tt(e, t, r) {
786
786
  h.inherits(tt, F, {
787
787
  __CANCEL__: !0
788
788
  });
789
- function Ts(e, t, r) {
789
+ function Ws(e, t, r) {
790
790
  const n = r.config.validateStatus;
791
791
  !r.status || !n || n(r.status) ? e(r) : t(new F(
792
792
  "Request failed with status code " + r.status,
@@ -796,7 +796,7 @@ function Ts(e, t, r) {
796
796
  r
797
797
  ));
798
798
  }
799
- const Ws = we.hasStandardBrowserEnv ? (
799
+ const Ts = we.hasStandardBrowserEnv ? (
800
800
  // Standard browser envs support document.cookie
801
801
  {
802
802
  write(e, t, r, n, o, s) {
@@ -939,7 +939,7 @@ const Xs = typeof XMLHttpRequest < "u", Zs = Xs && function(e) {
939
939
  config: e,
940
940
  request: l
941
941
  };
942
- Ts(function(x) {
942
+ Ws(function(x) {
943
943
  r(x), d();
944
944
  }, function(x) {
945
945
  n(x), d();
@@ -961,7 +961,7 @@ const Xs = typeof XMLHttpRequest < "u", Zs = Xs && function(e) {
961
961
  l
962
962
  )), l = null;
963
963
  }, we.hasStandardBrowserEnv && (c && h.isFunction(c) && (c = c(e)), c || c !== !1 && Ys(S))) {
964
- const b = e.xsrfHeaderName && e.xsrfCookieName && Ws.read(e.xsrfCookieName);
964
+ const b = e.xsrfHeaderName && e.xsrfCookieName && Ts.read(e.xsrfCookieName);
965
965
  b && s.set(e.xsrfHeaderName, b);
966
966
  }
967
967
  o === void 0 && s.setContentType(null), "setRequestHeader" in l && h.forEach(s.toJSON(), function(N, M) {
@@ -1346,7 +1346,7 @@ function ti(e) {
1346
1346
  function ri(e) {
1347
1347
  return h.isObject(e) && e.isAxiosError === !0;
1348
1348
  }
1349
- const Tt = {
1349
+ const Wt = {
1350
1350
  Continue: 100,
1351
1351
  SwitchingProtocols: 101,
1352
1352
  Processing: 102,
@@ -1411,8 +1411,8 @@ const Tt = {
1411
1411
  NotExtended: 510,
1412
1412
  NetworkAuthenticationRequired: 511
1413
1413
  };
1414
- Object.entries(Tt).forEach(([e, t]) => {
1415
- Tt[t] = e;
1414
+ Object.entries(Wt).forEach(([e, t]) => {
1415
+ Wt[t] = e;
1416
1416
  });
1417
1417
  function qn(e) {
1418
1418
  const t = new Ie(e), r = Sn(Ie.prototype.request, t);
@@ -1438,7 +1438,7 @@ H.mergeConfig = ze;
1438
1438
  H.AxiosHeaders = he;
1439
1439
  H.formToJSON = (e) => Fn(h.isHTMLForm(e) ? new FormData(e) : e);
1440
1440
  H.getAdapter = Bn.getAdapter;
1441
- H.HttpStatusCode = Tt;
1441
+ H.HttpStatusCode = Wt;
1442
1442
  H.default = H;
1443
1443
  const He = () => localStorage.getItem("token");
1444
1444
  async function G(e, t, r, n = !0) {
@@ -1483,10 +1483,10 @@ var Ke;
1483
1483
  (function(e) {
1484
1484
  e[e.LocalPath = 0] = "LocalPath", e[e.TencentCos = 1] = "TencentCos", e[e.ObjectUrl = 2] = "ObjectUrl", e[e.AliYunOss = 3] = "AliYunOss";
1485
1485
  })(Ke || (Ke = {}));
1486
- var Wt;
1486
+ var Tt;
1487
1487
  (function(e) {
1488
1488
  e[e.TaskAction = 0] = "TaskAction", e[e.WorkAction = 1] = "WorkAction", e[e.MqttSend = 3] = "MqttSend", e[e.ActionClose = 4] = "ActionClose", e[e.MqttReconnect = 5] = "MqttReconnect", e[e.NavigateTo = 7] = "NavigateTo", e[e.OpenTool = 10] = "OpenTool", e[e.DownloadFile = 11] = "DownloadFile";
1489
- })(Wt || (Wt = {}));
1489
+ })(Tt || (Tt = {}));
1490
1490
  var Ht;
1491
1491
  (function(e) {
1492
1492
  e[e.TaskAction = 0] = "TaskAction", e[e.NavigateTo = 3] = "NavigateTo", e[e.OpenTool = 6] = "OpenTool", e[e.MqttBack = 1] = "MqttBack", e[e.ExtensionBlobUrl = 4] = "ExtensionBlobUrl", e[e.ExtensionId = 5] = "ExtensionId", e[e.UrlCallback = 7] = "UrlCallback", e[e.DownloadFileRes = 8] = "DownloadFileRes";
@@ -1562,8 +1562,9 @@ const ci = (e) => e >= 1073741824 ? (e / 1073741824).toFixed(2) + " GB" : e >= 1
1562
1562
  for (; (r = hi.exec(e)) !== null; )
1563
1563
  r && r.length > 0 && n.push(r[1]);
1564
1564
  return n.map((o) => {
1565
- const s = t[o];
1566
- s && (e = e.replace(`$${o}$`, o.split(".").length == 2 ? s[o.split(".")[1]] : s));
1565
+ const s = o.split(".");
1566
+ let i = "";
1567
+ s.length == 2 ? i = t[s[0]][s[1]] : i = t[o], i && (e = e.replace(`$${o}$`, i));
1567
1568
  }), e;
1568
1569
  }, mi = (e) => Object.keys(e).filter((t) => e[t]).map((t) => {
1569
1570
  let r = e[t];
@@ -1579,10 +1580,10 @@ const ci = (e) => e >= 1073741824 ? (e / 1073741824).toFixed(2) + " GB" : e >= 1
1579
1580
  var n;
1580
1581
  const r = document.createElement("a");
1581
1582
  r.style.display = "none", r.href = e, t ? r.download = t : r.download = ((n = e.split("?").shift()) == null ? void 0 : n.split("/").pop()) || e, document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(e);
1582
- }, Y = process.env.NODE_ENV == "production" ? "https://api.zyjj.cc/api/v1" : "http://127.0.0.1:3000/api/v1", gi = process.env.NODE_ENV == "production" ? "https://knowledge.zyjj.cc/api/v1" : "http://127.0.0.1:3001/api/v1", bi = (e) => G(`${Y}/common/user/login`, e, "post"), wi = (e, t, r) => G(`${Y}/common/app/info?os=${e}&version=${t}&uid=${r || ""}`, {}, "get"), Ei = (e) => G(`${Y}/common/user/register`, e, "post"), Si = (e) => G(`${Y}/common/user/reset/password`, e, "post"), Tn = (e) => G(`${Y}/common/user/email/token`, { email: e }, "post"), Wn = () => G(`${Y}/user/user/info`, {}, "get", !1), _i = (e) => G(`${Y}/user/user/info`, e, "put"), Oi = (e) => G(`${Y}/user/point/deducting`, e, "post"), vi = (e) => G(`${Y}/common/tool/list?${Vn(e)}`, {}, "get"), Ri = () => G(`${Y}/common/tool/all`, {}, "get"), Ci = (e) => G(`${Y}/common/tool/${e}`, {}, "get"), Di = (e) => G(`${Y}/common/tool/inc/${e}`, {}, "get"), Pi = () => G(`${Y}/common/tool/tags`, {}, "get"), Hn = () => G(`${Y}/user/cloud/tencent/cos`, {}, "get"), xi = () => G(`${Y}/user/cloud/aliyun/oss`, {}, "get"), ji = (e) => G(`${Y}/user/task`, e, "post"), Ni = (e) => G(`${Y}/user/task/${e}`, {}, "get"), Gn = () => G(`${Y}/user/cloud/mqtt/task`, {}, "get"), ki = () => G(`${Y}/common/material/tags`, {}, "get"), Ai = (e) => G(`${Y}/user/material/${e}`, {}, "get"), Ii = (e) => G(`${Y}/user/material/url`, { key_list: e }, "post"), bc = (e) => G(`${Y}${e.url}`, e.data || {}, e.method), wc = (e) => G(`${gi}${e.url}`, e.data || {}, e.method);
1583
+ }, Y = process.env.NODE_ENV == "production" ? "https://api.zyjj.cc/api/v1" : "http://127.0.0.1:3000/api/v1", gi = process.env.NODE_ENV == "production" ? "https://knowledge.zyjj.cc/api/v1" : "http://127.0.0.1:3001/api/v1", bi = (e) => G(`${Y}/common/user/login`, e, "post"), wi = (e, t, r) => G(`${Y}/common/app/info?os=${e}&version=${t}&uid=${r || ""}`, {}, "get"), Ei = (e) => G(`${Y}/common/user/register`, e, "post"), Si = (e) => G(`${Y}/common/user/reset/password`, e, "post"), Wn = (e) => G(`${Y}/common/user/email/token`, { email: e }, "post"), Tn = () => G(`${Y}/user/user/info`, {}, "get", !1), _i = (e) => G(`${Y}/user/user/info`, e, "put"), Oi = (e) => G(`${Y}/user/point/deducting`, e, "post"), vi = (e) => G(`${Y}/common/tool/list?${Vn(e)}`, {}, "get"), Ri = () => G(`${Y}/common/tool/all`, {}, "get"), Ci = (e) => G(`${Y}/common/tool/${e}`, {}, "get"), Di = (e) => G(`${Y}/common/tool/inc/${e}`, {}, "get"), Pi = () => G(`${Y}/common/tool/tags`, {}, "get"), Hn = () => G(`${Y}/user/cloud/tencent/cos`, {}, "get"), xi = () => G(`${Y}/user/cloud/aliyun/oss`, {}, "get"), ji = (e) => G(`${Y}/user/task`, e, "post"), Ni = (e) => G(`${Y}/user/task/${e}`, {}, "get"), Gn = () => G(`${Y}/user/cloud/mqtt/task`, {}, "get"), ki = () => G(`${Y}/common/material/tags`, {}, "get"), Ai = (e) => G(`${Y}/user/material/${e}`, {}, "get"), Ii = (e) => G(`${Y}/user/material/url`, { key_list: e }, "post"), bc = (e) => G(`${Y}${e.url}`, e.data || {}, e.method), wc = (e) => G(`${gi}${e.url}`, e.data || {}, e.method);
1583
1584
  var Kt;
1584
1585
  (function(e) {
1585
- e[e.Task = 0] = "Task", e[e.Lab = 1] = "Lab", e[e.Flow = 2] = "Flow";
1586
+ e[e.Task = 0] = "Task", e[e.Lab = 1] = "Lab", e[e.Flow = 2] = "Flow", e[e.Custom = 3] = "Custom";
1586
1587
  })(Kt || (Kt = {}));
1587
1588
  var Xt;
1588
1589
  (function(e) {
@@ -1676,7 +1677,7 @@ function Ui() {
1676
1677
  }
1677
1678
  var I = !1, V = !1, B = !1, Z = !1, A = !1, ee;
1678
1679
  ee = Symbol.for("react.module.reference");
1679
- function T(a) {
1680
+ function W(a) {
1680
1681
  return !!(typeof a == "string" || typeof a == "function" || a === n || a === s || A || a === o || a === d || a === f || Z || a === v || I || V || B || typeof a == "object" && a !== null && (a.$$typeof === S || a.$$typeof === l || a.$$typeof === i || a.$$typeof === c || a.$$typeof === u || // This needs to include all possible module reference object
1681
1682
  // types supported by any Flight configuration anywhere since
1682
1683
  // we don't know which Flight build this will end up being used
@@ -1738,14 +1739,14 @@ function Ui() {
1738
1739
  }
1739
1740
  return null;
1740
1741
  }
1741
- var O = Object.assign, w = 0, y, _, E, D, P, q, W;
1742
+ var O = Object.assign, w = 0, y, _, E, D, P, q, T;
1742
1743
  function J() {
1743
1744
  }
1744
1745
  J.__reactDisabledLog = !0;
1745
1746
  function re() {
1746
1747
  {
1747
1748
  if (w === 0) {
1748
- y = console.log, _ = console.info, E = console.warn, D = console.error, P = console.group, q = console.groupCollapsed, W = console.groupEnd;
1749
+ y = console.log, _ = console.info, E = console.warn, D = console.error, P = console.group, q = console.groupCollapsed, T = console.groupEnd;
1749
1750
  var a = {
1750
1751
  configurable: !0,
1751
1752
  enumerable: !0,
@@ -1793,7 +1794,7 @@ function Ui() {
1793
1794
  value: q
1794
1795
  }),
1795
1796
  groupEnd: O({}, a, {
1796
- value: W
1797
+ value: T
1797
1798
  })
1798
1799
  });
1799
1800
  }
@@ -1977,7 +1978,7 @@ function Ui() {
1977
1978
  if (bo(a))
1978
1979
  return j("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", go(a)), jr(a);
1979
1980
  }
1980
- var Te = M.ReactCurrentOwner, wo = {
1981
+ var We = M.ReactCurrentOwner, wo = {
1981
1982
  key: !0,
1982
1983
  ref: !0,
1983
1984
  __self: !0,
@@ -2001,9 +2002,9 @@ function Ui() {
2001
2002
  return a.key !== void 0;
2002
2003
  }
2003
2004
  function _o(a, p) {
2004
- if (typeof a.ref == "string" && Te.current && p && Te.current.stateNode !== p) {
2005
- var g = le(Te.current.type);
2006
- Rt[g] || (j('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', le(Te.current.type), a.ref), Rt[g] = !0);
2005
+ if (typeof a.ref == "string" && We.current && p && We.current.stateNode !== p) {
2006
+ var g = le(We.current.type);
2007
+ Rt[g] || (j('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', le(We.current.type), a.ref), Rt[g] = !0);
2007
2008
  }
2008
2009
  }
2009
2010
  function Oo(a, p) {
@@ -2072,7 +2073,7 @@ function Ui() {
2072
2073
  var Q = typeof a == "function" ? a.displayName || a.name || "Unknown" : a;
2073
2074
  k && Oo($, Q), oe && vo($, Q);
2074
2075
  }
2075
- return Ro(a, k, oe, z, R, Te.current, $);
2076
+ return Ro(a, k, oe, z, R, We.current, $);
2076
2077
  }
2077
2078
  }
2078
2079
  var Ct = M.ReactCurrentOwner, Ir = M.ReactDebugCurrentFrame;
@@ -2187,7 +2188,7 @@ Check the top-level render call using <` + g + ">.");
2187
2188
  }
2188
2189
  function Br(a, p, g, R, z, L) {
2189
2190
  {
2190
- var $ = T(a);
2191
+ var $ = W(a);
2191
2192
  if (!$) {
2192
2193
  var k = "";
2193
2194
  (a === void 0 || typeof a == "object" && a !== null && Object.keys(a).length === 0) && (k += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
@@ -2267,13 +2268,13 @@ var C = rr.exports, Yn = { exports: {} };
2267
2268
  B[q] = w, E = q;
2268
2269
  }
2269
2270
  return !_ && E && (V = E), E || !_ && V;
2270
- }, T = function(O, w) {
2271
+ }, W = function(O, w) {
2271
2272
  if (A(O)) return O.clone();
2272
2273
  var y = typeof w == "object" ? w : {};
2273
2274
  return y.date = O, y.args = arguments, new xe(y);
2274
2275
  }, U = I;
2275
2276
  U.l = ee, U.i = A, U.w = function(O, w) {
2276
- return T(O, { locale: w.$L, utc: w.$u, x: w.$x, $offset: w.$offset });
2277
+ return W(O, { locale: w.$L, utc: w.$u, x: w.$x, $offset: w.$offset });
2277
2278
  };
2278
2279
  var xe = function() {
2279
2280
  function O(y) {
@@ -2289,8 +2290,8 @@ var C = rr.exports, Yn = { exports: {} };
2289
2290
  if (typeof E == "string" && !/Z$/i.test(E)) {
2290
2291
  var P = E.match(N);
2291
2292
  if (P) {
2292
- var q = P[2] - 1 || 0, W = (P[7] || "0").substring(0, 3);
2293
- return D ? new Date(Date.UTC(P[1], q, P[3] || 1, P[4] || 0, P[5] || 0, P[6] || 0, W)) : new Date(P[1], q, P[3] || 1, P[4] || 0, P[5] || 0, P[6] || 0, W);
2293
+ var q = P[2] - 1 || 0, T = (P[7] || "0").substring(0, 3);
2294
+ return D ? new Date(Date.UTC(P[1], q, P[3] || 1, P[4] || 0, P[5] || 0, P[6] || 0, T)) : new Date(P[1], q, P[3] || 1, P[4] || 0, P[5] || 0, P[6] || 0, T);
2294
2295
  }
2295
2296
  }
2296
2297
  return new Date(E);
@@ -2303,12 +2304,12 @@ var C = rr.exports, Yn = { exports: {} };
2303
2304
  }, w.isValid = function() {
2304
2305
  return this.$d.toString() !== b;
2305
2306
  }, w.isSame = function(y, _) {
2306
- var E = T(y);
2307
+ var E = W(y);
2307
2308
  return this.startOf(_) <= E && E <= this.endOf(_);
2308
2309
  }, w.isAfter = function(y, _) {
2309
- return T(y) < this.startOf(_);
2310
+ return W(y) < this.startOf(_);
2310
2311
  }, w.isBefore = function(y, _) {
2311
- return this.endOf(_) < T(y);
2312
+ return this.endOf(_) < W(y);
2312
2313
  }, w.$g = function(y, _, E) {
2313
2314
  return U.u(y) ? this[_] : this.set(E, y);
2314
2315
  }, w.unix = function() {
@@ -2319,7 +2320,7 @@ var C = rr.exports, Yn = { exports: {} };
2319
2320
  var E = this, D = !!U.u(_) || _, P = U.p(y), q = function(me, te) {
2320
2321
  var be = U.w(E.$u ? Date.UTC(E.$y, te, me) : new Date(E.$y, te, me), E);
2321
2322
  return D ? be : be.endOf(d);
2322
- }, W = function(me, te) {
2323
+ }, T = function(me, te) {
2323
2324
  return U.w(E.toDate()[me].apply(E.toDate("s"), (D ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(te)), E);
2324
2325
  }, J = this.$W, re = this.$M, ie = this.$D, ye = "set" + (this.$u ? "UTC" : "");
2325
2326
  switch (P) {
@@ -2332,24 +2333,24 @@ var C = rr.exports, Yn = { exports: {} };
2332
2333
  return q(D ? ie - ge : ie + (6 - ge), re);
2333
2334
  case d:
2334
2335
  case m:
2335
- return W(ye + "Hours", 0);
2336
+ return T(ye + "Hours", 0);
2336
2337
  case u:
2337
- return W(ye + "Minutes", 1);
2338
+ return T(ye + "Minutes", 1);
2338
2339
  case c:
2339
- return W(ye + "Seconds", 2);
2340
+ return T(ye + "Seconds", 2);
2340
2341
  case i:
2341
- return W(ye + "Milliseconds", 3);
2342
+ return T(ye + "Milliseconds", 3);
2342
2343
  default:
2343
2344
  return this.clone();
2344
2345
  }
2345
2346
  }, w.endOf = function(y) {
2346
2347
  return this.startOf(y, !1);
2347
2348
  }, w.$set = function(y, _) {
2348
- var E, D = U.p(y), P = "set" + (this.$u ? "UTC" : ""), q = (E = {}, E[d] = P + "Date", E[m] = P + "Date", E[l] = P + "Month", E[v] = P + "FullYear", E[u] = P + "Hours", E[c] = P + "Minutes", E[i] = P + "Seconds", E[s] = P + "Milliseconds", E)[D], W = D === d ? this.$D + (_ - this.$W) : _;
2349
+ var E, D = U.p(y), P = "set" + (this.$u ? "UTC" : ""), q = (E = {}, E[d] = P + "Date", E[m] = P + "Date", E[l] = P + "Month", E[v] = P + "FullYear", E[u] = P + "Hours", E[c] = P + "Minutes", E[i] = P + "Seconds", E[s] = P + "Milliseconds", E)[D], T = D === d ? this.$D + (_ - this.$W) : _;
2349
2350
  if (D === l || D === v) {
2350
2351
  var J = this.clone().set(m, 1);
2351
- J.$d[q](W), J.init(), this.$d = J.set(m, Math.min(this.$D, J.daysInMonth())).$d;
2352
- } else q && this.$d[q](W);
2352
+ J.$d[q](T), J.init(), this.$d = J.set(m, Math.min(this.$D, J.daysInMonth())).$d;
2353
+ } else q && this.$d[q](T);
2353
2354
  return this.init(), this;
2354
2355
  }, w.set = function(y, _) {
2355
2356
  return this.clone().$set(y, _);
@@ -2359,21 +2360,21 @@ var C = rr.exports, Yn = { exports: {} };
2359
2360
  var E, D = this;
2360
2361
  y = Number(y);
2361
2362
  var P = U.p(_), q = function(re) {
2362
- var ie = T(D);
2363
+ var ie = W(D);
2363
2364
  return U.w(ie.date(ie.date() + Math.round(re * y)), D);
2364
2365
  };
2365
2366
  if (P === l) return this.set(l, this.$M + y);
2366
2367
  if (P === v) return this.set(v, this.$y + y);
2367
2368
  if (P === d) return q(1);
2368
2369
  if (P === f) return q(7);
2369
- var W = (E = {}, E[c] = n, E[u] = o, E[i] = r, E)[P] || 1, J = this.$d.getTime() + y * W;
2370
+ var T = (E = {}, E[c] = n, E[u] = o, E[i] = r, E)[P] || 1, J = this.$d.getTime() + y * T;
2370
2371
  return U.w(J, this);
2371
2372
  }, w.subtract = function(y, _) {
2372
2373
  return this.add(-1 * y, _);
2373
2374
  }, w.format = function(y) {
2374
2375
  var _ = this, E = this.$locale();
2375
2376
  if (!this.isValid()) return E.invalidDate || b;
2376
- var D = y || "YYYY-MM-DDTHH:mm:ssZ", P = U.z(this), q = this.$H, W = this.$m, J = this.$M, re = E.weekdays, ie = E.months, ye = E.meridiem, pe = function(te, be, ve, Me) {
2377
+ var D = y || "YYYY-MM-DDTHH:mm:ssZ", P = U.z(this), q = this.$H, T = this.$m, J = this.$M, re = E.weekdays, ie = E.months, ye = E.meridiem, pe = function(te, be, ve, Me) {
2377
2378
  return te && (te[be] || te(_, D)) || ve[be].slice(0, Me);
2378
2379
  }, ge = function(te) {
2379
2380
  return U.s(q % 12 || 12, te, "0");
@@ -2417,13 +2418,13 @@ var C = rr.exports, Yn = { exports: {} };
2417
2418
  case "hh":
2418
2419
  return ge(2);
2419
2420
  case "a":
2420
- return me(q, W, !0);
2421
+ return me(q, T, !0);
2421
2422
  case "A":
2422
- return me(q, W, !1);
2423
+ return me(q, T, !1);
2423
2424
  case "m":
2424
- return String(W);
2425
+ return String(T);
2425
2426
  case "mm":
2426
- return U.s(W, 2, "0");
2427
+ return U.s(T, 2, "0");
2427
2428
  case "s":
2428
2429
  return String(_.$s);
2429
2430
  case "ss":
@@ -2439,8 +2440,8 @@ var C = rr.exports, Yn = { exports: {} };
2439
2440
  }, w.utcOffset = function() {
2440
2441
  return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
2441
2442
  }, w.diff = function(y, _, E) {
2442
- var D, P = this, q = U.p(_), W = T(y), J = (W.utcOffset() - this.utcOffset()) * n, re = this - W, ie = function() {
2443
- return U.m(P, W);
2443
+ var D, P = this, q = U.p(_), T = W(y), J = (T.utcOffset() - this.utcOffset()) * n, re = this - T, ie = function() {
2444
+ return U.m(P, T);
2444
2445
  };
2445
2446
  switch (q) {
2446
2447
  case v:
@@ -2491,20 +2492,20 @@ var C = rr.exports, Yn = { exports: {} };
2491
2492
  return this.$d.toUTCString();
2492
2493
  }, O;
2493
2494
  }(), le = xe.prototype;
2494
- return T.prototype = le, [["$ms", s], ["$s", i], ["$m", c], ["$H", u], ["$W", d], ["$M", l], ["$y", v], ["$D", m]].forEach(function(O) {
2495
+ return W.prototype = le, [["$ms", s], ["$s", i], ["$m", c], ["$H", u], ["$W", d], ["$M", l], ["$y", v], ["$D", m]].forEach(function(O) {
2495
2496
  le[O[1]] = function(w) {
2496
2497
  return this.$g(w, O[0], O[1]);
2497
2498
  };
2498
- }), T.extend = function(O, w) {
2499
- return O.$i || (O(w, xe, T), O.$i = !0), T;
2500
- }, T.locale = ee, T.isDayjs = A, T.unix = function(O) {
2501
- return T(1e3 * O);
2502
- }, T.en = B[V], T.Ls = B, T.p = {}, T;
2499
+ }), W.extend = function(O, w) {
2500
+ return O.$i || (O(w, xe, W), O.$i = !0), W;
2501
+ }, W.locale = ee, W.isDayjs = A, W.unix = function(O) {
2502
+ return W(1e3 * O);
2503
+ }, W.en = B[V], W.Ls = B, W.p = {}, W;
2503
2504
  });
2504
2505
  })(Yn);
2505
2506
  var Bi = Yn.exports;
2506
2507
  const zi = /* @__PURE__ */ Fi(Bi), qi = (e) => zi(e).format("YYYY-MM-DD HH:mm:ss"), Vi = (e) => C.jsx(wn.Paragraph, { copyable: !0, children: e }), Li = (e) => C.jsx(wn.Ellipsis, { style: { maxWidth: 300 }, rows: 1, showTooltip: !0, children: e });
2507
- function Ti(e) {
2508
+ function Wi(e) {
2508
2509
  if (typeof e != "object" || e === null)
2509
2510
  return !1;
2510
2511
  let t = e;
@@ -2512,8 +2513,8 @@ function Ti(e) {
2512
2513
  t = Object.getPrototypeOf(t);
2513
2514
  return Object.getPrototypeOf(e) === t || Object.getPrototypeOf(e) === null;
2514
2515
  }
2515
- function Wi(e) {
2516
- return Ti(e) && "type" in e && typeof e.type == "string";
2516
+ function Ti(e) {
2517
+ return Wi(e) && "type" in e && typeof e.type == "string";
2517
2518
  }
2518
2519
  var Jn = Symbol.for("immer-nothing"), rn = Symbol.for("immer-draftable"), ce = Symbol.for("immer-state"), Hi = process.env.NODE_ENV !== "production" ? [
2519
2520
  // All error codes, starting by 0:
@@ -3163,12 +3164,12 @@ function no(e, ...t) {
3163
3164
  Z,
3164
3165
  c
3165
3166
  ), ee.shouldRun) {
3166
- const T = un(
3167
+ const W = un(
3167
3168
  j,
3168
3169
  arguments
3169
3170
  );
3170
3171
  ee.run(
3171
- { inputSelectorResults: Z, inputSelectorResultsCopy: T },
3172
+ { inputSelectorResults: Z, inputSelectorResultsCopy: W },
3172
3173
  { memoize: l, memoizeOptions: N },
3173
3174
  arguments
3174
3175
  );
@@ -3246,7 +3247,7 @@ function _e(e, t) {
3246
3247
  payload: n[0]
3247
3248
  };
3248
3249
  }
3249
- return r.toString = () => `${e}`, r.type = e, r.match = (n) => Wi(n) && n.type === e, r;
3250
+ return r.toString = () => `${e}`, r.type = e, r.match = (n) => Ti(n) && n.type === e, r;
3250
3251
  }
3251
3252
  function fn(e) {
3252
3253
  return Oe(e) ? ro(e, () => {
@@ -3587,8 +3588,8 @@ function Pa({
3587
3588
  return dn(A, Z, {
3588
3589
  insert: () => {
3589
3590
  const ee = {};
3590
- for (const [T, U] of Object.entries(o.selectors ?? {}))
3591
- ee[T] = xa(U, Z, N, I);
3591
+ for (const [W, U] of Object.entries(o.selectors ?? {}))
3592
+ ee[W] = xa(U, Z, N, I);
3592
3593
  return ee;
3593
3594
  }
3594
3595
  });
@@ -3769,7 +3770,7 @@ const za = {
3769
3770
  showLogin: !1
3770
3771
  }, ur = Cr("user/getUserInfo", async () => {
3771
3772
  if (localStorage.getItem("token"))
3772
- return await Wn();
3773
+ return await Tn();
3773
3774
  }), ao = io({
3774
3775
  name: "user",
3775
3776
  initialState: za,
@@ -3803,7 +3804,7 @@ function La() {
3803
3804
  IDBTransaction
3804
3805
  ]);
3805
3806
  }
3806
- function Ta() {
3807
+ function Wa() {
3807
3808
  return mn || (mn = [
3808
3809
  IDBCursor.prototype.advance,
3809
3810
  IDBCursor.prototype.continue,
@@ -3811,7 +3812,7 @@ function Ta() {
3811
3812
  ]);
3812
3813
  }
3813
3814
  const fr = /* @__PURE__ */ new WeakMap(), Mt = /* @__PURE__ */ new WeakMap(), Ot = /* @__PURE__ */ new WeakMap();
3814
- function Wa(e) {
3815
+ function Ta(e) {
3815
3816
  const t = new Promise((r, n) => {
3816
3817
  const o = () => {
3817
3818
  e.removeEventListener("success", s), e.removeEventListener("error", i);
@@ -3860,7 +3861,7 @@ function co(e) {
3860
3861
  dr = e(dr);
3861
3862
  }
3862
3863
  function Ga(e) {
3863
- return Ta().includes(e) ? function(...t) {
3864
+ return Wa().includes(e) ? function(...t) {
3864
3865
  return e.apply(hr(this), t), $e(this.request);
3865
3866
  } : function(...t) {
3866
3867
  return $e(e.apply(hr(this), t));
@@ -3871,7 +3872,7 @@ function Ya(e) {
3871
3872
  }
3872
3873
  function $e(e) {
3873
3874
  if (e instanceof IDBRequest)
3874
- return Wa(e);
3875
+ return Ta(e);
3875
3876
  if (Mt.has(e))
3876
3877
  return Mt.get(e);
3877
3878
  const t = Ya(e);
@@ -4046,7 +4047,7 @@ const lc = (e) => {
4046
4047
  }) : Ei(c).then(() => {
4047
4048
  Ce.success("注册成功,请登录"), o(!0);
4048
4049
  });
4049
- }, i = () => Tn(t);
4050
+ }, i = () => Wn(t);
4050
4051
  return C.jsxs(se, { autoComplete: "off", onSubmit: s, children: [C.jsx(se.Item, { rules: [{ required: !0, type: "email", message: "输入正确的邮箱格式" }], field: "email", label: "邮箱", children: C.jsx(ke, { onChange: r, placeholder: "输入邮箱" }) }), C.jsx(se.Item, { rules: [{ required: !0, type: "string", minLength: 8, message: "密码不能小于8位" }], field: "password", label: "密码", children: C.jsx(ke.Password, { placeholder: "输入密码" }) }), n ? null : C.jsx(se.Item, { label: "验证码", field: "token", rules: [{ required: !0, message: "验证码必填" }], children: C.jsx(ho, { callback: i }) }), C.jsx(se.Item, { wrapperCol: { offset: 5 }, children: C.jsxs(br, { children: [C.jsx(Ae, { type: "primary", htmlType: "submit", children: n ? "立即登录" : "注册账号" }), C.jsx(Ae, { type: "text", onClick: () => o((c) => !c), children: n ? "新用户?" : "已有账号?" }), n ? C.jsx(Ae, { onClick: () => e.onForget(), type: "text", children: "忘记密码?" }) : null] }) })] });
4051
4052
  };
4052
4053
  function fc(e) {
@@ -4059,7 +4060,7 @@ function fc(e) {
4059
4060
  Si({ email: i, password: c, token: u }).then(() => {
4060
4061
  Ce.success("密码重置成功,请登录"), e.onLogin();
4061
4062
  });
4062
- }, o = () => Tn(t);
4063
+ }, o = () => Wn(t);
4063
4064
  return C.jsx("div", { children: C.jsxs(se, { style: { width: 370 }, autoComplete: "off", onSubmit: n, children: [C.jsx(se.Item, { rules: [{ required: !0, type: "email", message: "输入正确的邮箱格式" }], label: "邮箱", field: "email", children: C.jsx(ke, { onChange: r, placeholder: "输入邮箱" }) }), C.jsx(se.Item, { label: "验证码", field: "token", rules: [{ required: !0, message: "验证码必填" }], children: C.jsx(ho, { callback: o }) }), C.jsx(se.Item, { rules: [{ required: !0, type: "string", minLength: 8, message: "密码不能小于8位" }], label: "新密码", field: "password", children: C.jsx(ke, { type: "password", placeholder: "输入新密码" }) }), C.jsx(se.Item, { rules: [{ required: !0, type: "string", minLength: 8, message: "密码不能小于8位" }], label: "重复", field: "password_repeat", children: C.jsx(ke, { type: "password", placeholder: "再输入一遍新密码" }) }), C.jsx(se.Item, { wrapperCol: { offset: 5 }, children: C.jsxs(br, { children: [C.jsx(Ae, { type: "primary", htmlType: "submit", children: "立即重置" }), C.jsx(Ae, { onClick: () => e.onLogin(), type: "text", children: "重新登录" })] }) })] }) });
4064
4065
  }
4065
4066
  function Ec(e) {
@@ -4096,7 +4097,7 @@ const _c = {
4096
4097
  UpdateUserInfo: _i,
4097
4098
  GetAppInfo: wi,
4098
4099
  CostPoint: Oi,
4099
- GetUserInfo: Wn,
4100
+ GetUserInfo: Tn,
4100
4101
  UserDownloadMaterial: Ai,
4101
4102
  GetMqttTaskClientInfo: Gn,
4102
4103
  AddTask: ji,
@@ -4109,7 +4110,7 @@ const _c = {
4109
4110
  GetToolDetail: Ci
4110
4111
  }, Oc = {
4111
4112
  ToolType: Kt,
4112
- LocalActionReqType: Wt,
4113
+ LocalActionReqType: Tt,
4113
4114
  LocalActionResType: Ht,
4114
4115
  MQTTEventType: Ne,
4115
4116
  FileSource: Ke,
package/lib/index.umd.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[Hr]=this[Hr]={accessors:{}}).accessors,o=this.prototype;function s(i){const c=He(i);n[c]||(ss(o,i),n[c]=!0)}return h.isArray(t)?t.forEach(s):s(t),this}}he.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),h.reduceDescriptors(he.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),h.freezeMethods(he);function xt(e,t){const r=this||We,n=t||r,o=he.from(n.headers);let s=n.data;return h.forEach(e,function(c){s=c.call(r,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function Gr(e){return!!(e&&e.__CANCEL__)}function Ge(e,t,r){F.call(this,e??"canceled",F.ERR_CANCELED,t,r),this.name="CanceledError"}h.inherits(Ge,F,{__CANCEL__:!0});function is(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new F("Request failed with status code "+r.status,[F.ERR_BAD_REQUEST,F.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}const as=we.hasStandardBrowserEnv?{write(e,t,r,n,o,s){const i=[e+"="+encodeURIComponent(t)];h.isNumber(r)&&i.push("expires="+new Date(r).toGMTString()),h.isString(n)&&i.push("path="+n),h.isString(o)&&i.push("domain="+o),s===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function cs(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function us(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Yr(e,t){return e&&!cs(t)?us(e,t):t}const ls=we.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");let n;function o(s){let i=s;return t&&(r.setAttribute("href",i),i=r.href),r.setAttribute("href",i),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=o(window.location.href),function(i){const c=h.isString(i)?o(i):i;return c.protocol===n.protocol&&c.host===n.host}}():function(){return function(){return!0}}();function fs(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function ds(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,s=0,i;return t=t!==void 0?t:1e3,function(u){const d=Date.now(),f=n[s];i||(i=d),r[o]=u,n[o]=d;let l=s,E=0;for(;l!==o;)E+=r[l++],l=l%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),d-i<t)return;const C=f&&d-f;return C?Math.round(E*1e3/C):void 0}}function Jr(e,t){let r=0;const n=ds(50,250);return o=>{const s=o.loaded,i=o.lengthComputable?o.total:void 0,c=s-r,u=n(c),d=s<=i;r=s;const f={loaded:s,total:i,progress:i?s/i:void 0,bytes:c,rate:u||void 0,estimated:u&&i&&d?(i-s)/u:void 0,event:o};f[t?"download":"upload"]=!0,e(f)}}const jt={http:qo,xhr:typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){let o=e.data;const s=he.from(e.headers).normalize();let{responseType:i,withXSRFToken:c}=e,u;function d(){e.cancelToken&&e.cancelToken.unsubscribe(u),e.signal&&e.signal.removeEventListener("abort",u)}let f;if(h.isFormData(o)){if(we.hasStandardBrowserEnv||we.hasStandardBrowserWebWorkerEnv)s.setContentType(!1);else if((f=s.getContentType())!==!1){const[b,...k]=f?f.split(";").map(U=>U.trim()).filter(Boolean):[];s.setContentType([b||"multipart/form-data",...k].join("; "))}}let l=new XMLHttpRequest;if(e.auth){const b=e.auth.username||"",k=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";s.set("Authorization","Basic "+btoa(b+":"+k))}const E=Yr(e.baseURL,e.url);l.open(e.method.toUpperCase(),Vr(E,e.params,e.paramsSerializer),!0),l.timeout=e.timeout;function C(){if(!l)return;const b=he.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),U={data:!i||i==="text"||i==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:b,config:e,request:l};is(function(j){r(j),d()},function(j){n(j),d()},U),l=null}if("onloadend"in l?l.onloadend=C:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(C)},l.onabort=function(){l&&(n(new F("Request aborted",F.ECONNABORTED,e,l)),l=null)},l.onerror=function(){n(new F("Network Error",F.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let k=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const U=e.transitional||qr;e.timeoutErrorMessage&&(k=e.timeoutErrorMessage),n(new F(k,U.clarifyTimeoutError?F.ETIMEDOUT:F.ECONNABORTED,e,l)),l=null},we.hasStandardBrowserEnv&&(c&&h.isFunction(c)&&(c=c(e)),c||c!==!1&&ls(E))){const b=e.xsrfHeaderName&&e.xsrfCookieName&&as.read(e.xsrfCookieName);b&&s.set(e.xsrfHeaderName,b)}o===void 0&&s.setContentType(null),"setRequestHeader"in l&&h.forEach(s.toJSON(),function(k,U){l.setRequestHeader(U,k)}),h.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),i&&i!=="json"&&(l.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&l.addEventListener("progress",Jr(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",Jr(e.onUploadProgress)),(e.cancelToken||e.signal)&&(u=b=>{l&&(n(!b||b.type?new Ge(null,e,l):b),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(u),e.signal&&(e.signal.aborted?u():e.signal.addEventListener("abort",u)));const m=fs(E);if(m&&we.protocols.indexOf(m)===-1){n(new F("Unsupported protocol "+m+":",F.ERR_BAD_REQUEST,e));return}l.send(o||null)})}};h.forEach(jt,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Kr=e=>`- ${e}`,hs=e=>h.isFunction(e)||e===null||e===!1,Xr={getAdapter:e=>{e=h.isArray(e)?e:[e];const{length:t}=e;let r,n;const o={};for(let s=0;s<t;s++){r=e[s];let i;if(n=r,!hs(r)&&(n=jt[(i=String(r)).toLowerCase()],n===void 0))throw new F(`Unknown adapter '${i}'`);if(n)break;o[i||"#"+s]=n}if(!n){const s=Object.entries(o).map(([c,u])=>`adapter ${c} `+(u===!1?"is not supported by the environment":"is not available in the build"));let i=t?s.length>1?`since :
4
4
  `+s.map(Kr).join(`
5
5
  `):" "+Kr(s[0]):"as no adapter specified";throw new F("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return n},adapters:jt};function Nt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ge(null,e)}function Zr(e){return Nt(e),e.headers=he.from(e.headers),e.data=xt.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Xr.getAdapter(e.adapter||We.adapter)(e).then(function(n){return Nt(e),n.data=xt.call(e,e.transformResponse,n),n.headers=he.from(n.headers),n},function(n){return Gr(n)||(Nt(e),n&&n.response&&(n.response.data=xt.call(e,e.transformResponse,n.response),n.response.headers=he.from(n.response.headers))),Promise.reject(n)})}const Qr=e=>e instanceof he?{...e}:e;function $e(e,t){t=t||{};const r={};function n(d,f,l){return h.isPlainObject(d)&&h.isPlainObject(f)?h.merge.call({caseless:l},d,f):h.isPlainObject(f)?h.merge({},f):h.isArray(f)?f.slice():f}function o(d,f,l){if(h.isUndefined(f)){if(!h.isUndefined(d))return n(void 0,d,l)}else return n(d,f,l)}function s(d,f){if(!h.isUndefined(f))return n(void 0,f)}function i(d,f){if(h.isUndefined(f)){if(!h.isUndefined(d))return n(void 0,d)}else return n(void 0,f)}function c(d,f,l){if(l in t)return n(d,f);if(l in e)return n(void 0,d)}const u={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(d,f)=>o(Qr(d),Qr(f),!0)};return h.forEach(Object.keys(Object.assign({},e,t)),function(f){const l=u[f]||o,E=l(e[f],t[f],f);h.isUndefined(E)&&l!==c||(r[f]=E)}),r}const en="1.6.8",kt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{kt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const tn={};kt.transitional=function(t,r,n){function o(s,i){return"[Axios v"+en+"] Transitional option '"+s+"'"+i+(n?". "+n:"")}return(s,i,c)=>{if(t===!1)throw new F(o(i," has been removed"+(r?" in "+r:"")),F.ERR_DEPRECATED);return r&&!tn[i]&&(tn[i]=!0,console.warn(o(i," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(s,i,c):!0}};function ps(e,t,r){if(typeof e!="object")throw new F("options must be an object",F.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const s=n[o],i=t[s];if(i){const c=e[s],u=c===void 0||i(c,s,e);if(u!==!0)throw new F("option "+s+" must be "+u,F.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new F("Unknown option "+s,F.ERR_BAD_OPTION)}}const It={assertOptions:ps,validators:kt},De=It.validators;class xe{constructor(t){this.defaults=t,this.interceptors={request:new Lr,response:new Lr}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o;Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=`
6
- `+s):n.stack=s}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=$e(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:s}=r;n!==void 0&&It.assertOptions(n,{silentJSONParsing:De.transitional(De.boolean),forcedJSONParsing:De.transitional(De.boolean),clarifyTimeoutError:De.transitional(De.boolean)},!1),o!=null&&(h.isFunction(o)?r.paramsSerializer={serialize:o}:It.assertOptions(o,{encode:De.function,serialize:De.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=s&&h.merge(s.common,s[r.method]);s&&h.forEach(["delete","get","head","post","put","patch","common"],m=>{delete s[m]}),r.headers=he.concat(i,s);const c=[];let u=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(r)===!1||(u=u&&b.synchronous,c.unshift(b.fulfilled,b.rejected))});const d=[];this.interceptors.response.forEach(function(b){d.push(b.fulfilled,b.rejected)});let f,l=0,E;if(!u){const m=[Zr.bind(this),void 0];for(m.unshift.apply(m,c),m.push.apply(m,d),E=m.length,f=Promise.resolve(r);l<E;)f=f.then(m[l++],m[l++]);return f}E=c.length;let C=r;for(l=0;l<E;){const m=c[l++],b=c[l++];try{C=m(C)}catch(k){b.call(this,k);break}}try{f=Zr.call(this,C)}catch(m){return Promise.reject(m)}for(l=0,E=d.length;l<E;)f=f.then(d[l++],d[l++]);return f}getUri(t){t=$e(this.defaults,t);const r=Yr(t.baseURL,t.url);return Vr(r,t.params,t.paramsSerializer)}}h.forEach(["delete","get","head","options"],function(t){xe.prototype[t]=function(r,n){return this.request($e(n||{},{method:t,url:r,data:(n||{}).data}))}}),h.forEach(["post","put","patch"],function(t){function r(n){return function(s,i,c){return this.request($e(c||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}xe.prototype[t]=r(),xe.prototype[t+"Form"]=r(!0)});class At{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});const n=this;this.promise.then(o=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](o);n._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(c=>{n.subscribe(c),s=c}).then(o);return i.cancel=function(){n.unsubscribe(s)},i},t(function(s,i,c){n.reason||(n.reason=new Ge(s,i,c),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}static source(){let t;return{token:new At(function(o){t=o}),cancel:t}}}function ms(e){return function(r){return e.apply(null,r)}}function ys(e){return h.isObject(e)&&e.isAxiosError===!0}const Ft={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ft).forEach(([e,t])=>{Ft[t]=e});function rn(e){const t=new xe(e),r=Cr(xe.prototype.request,t);return h.extend(r,xe.prototype,t,{allOwnKeys:!0}),h.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return rn($e(e,o))},r}const H=rn(We);H.Axios=xe,H.CanceledError=Ge,H.CancelToken=At,H.isCancel=Gr,H.VERSION=en,H.toFormData=it,H.AxiosError=F,H.Cancel=H.CanceledError,H.all=function(t){return Promise.all(t)},H.spread=ms,H.isAxiosError=ys,H.mergeConfig=$e,H.AxiosHeaders=he,H.formToJSON=e=>Wr(h.isHTMLForm(e)?new FormData(e):e),H.getAdapter=Xr.getAdapter,H.HttpStatusCode=Ft,H.default=H;const Ye=()=>localStorage.getItem("token");async function J(e,t,r,n=!0){let o;return r==="get"?o=H.get(e,{params:t,timeout:1e3*60*10,headers:{Authorization:Ye()}}):r==="post"?o=H.post(e,t,{headers:{Authorization:Ye()}}):r==="put"?o=H.put(e,t,{headers:{Authorization:Ye()}}):r==="delete"?o=H.delete(e,{params:t,headers:{Authorization:Ye()}}):r==="patch"&&(o=H.patch(e,t,{headers:{Authorization:Ye()}})),new Promise((s,i)=>{o.then(c=>{c.data.code!==0?(n&&_.Message.error(c.data.msg),i(c.data.msg)):s(c.data.data)}).catch(c=>{var u;((u=c.response)==null?void 0:u.status)==401?n&&_.Message.error("你的账户已过期,请重新登录"):n&&_.Message.error("请求失败"),console.log("请求失败",c),i("请求失败")})})}let ct;const gs=new Uint8Array(16);function bs(){if(!ct&&(ct=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ct))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ct(gs)}const se=[];for(let e=0;e<256;++e)se.push((e+256).toString(16).slice(1));function ws(e,t=0){return se[e[t+0]]+se[e[t+1]]+se[e[t+2]]+se[e[t+3]]+"-"+se[e[t+4]]+se[e[t+5]]+"-"+se[e[t+6]]+se[e[t+7]]+"-"+se[e[t+8]]+se[e[t+9]]+"-"+se[e[t+10]]+se[e[t+11]]+se[e[t+12]]+se[e[t+13]]+se[e[t+14]]+se[e[t+15]]}const nn={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Ss(e,t,r){if(nn.randomUUID&&!t&&!e)return nn.randomUUID();e=e||{};const n=e.random||(e.rng||bs)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,ws(n)}var Je;(function(e){e[e.LocalPath=0]="LocalPath",e[e.TencentCos=1]="TencentCos",e[e.ObjectUrl=2]="ObjectUrl",e[e.AliYunOss=3]="AliYunOss"})(Je||(Je={}));var Mt;(function(e){e[e.TaskAction=0]="TaskAction",e[e.WorkAction=1]="WorkAction",e[e.MqttSend=3]="MqttSend",e[e.ActionClose=4]="ActionClose",e[e.MqttReconnect=5]="MqttReconnect",e[e.NavigateTo=7]="NavigateTo",e[e.OpenTool=10]="OpenTool",e[e.DownloadFile=11]="DownloadFile"})(Mt||(Mt={}));var $t;(function(e){e[e.TaskAction=0]="TaskAction",e[e.NavigateTo=3]="NavigateTo",e[e.OpenTool=6]="OpenTool",e[e.MqttBack=1]="MqttBack",e[e.ExtensionBlobUrl=4]="ExtensionBlobUrl",e[e.ExtensionId=5]="ExtensionId",e[e.UrlCallback=7]="UrlCallback",e[e.DownloadFileRes=8]="DownloadFileRes"})($t||($t={}));var Ut;(function(e){e.Waiting="等待",e.Running="进行",e.Fail="失败",e.Success="成功",e.Canceled="取消"})(Ut||(Ut={}));var Bt;(function(e){e[e.Start=1]="Start",e[e.Progress=2]="Progress",e[e.Success=3]="Success",e[e.Error=4]="Error",e[e.DetailAppend=5]="DetailAppend",e[e.DetailSet=6]="DetailSet"})(Bt||(Bt={}));var zt;(function(e){e[e.ChoosePic=-3]="ChoosePic",e[e.CostPoint=-4]="CostPoint",e[e.AddAction=-5]="AddAction",e[e.CloseWindow=-6]="CloseWindow",e[e.SendRequest=-7]="SendRequest",e[e.UploadFileByPath=-8]="UploadFileByPath",e[e.GetInitData=-9]="GetInitData"})(zt||(zt={}));const Es=e=>e>=1073741824?(e/1073741824).toFixed(2)+" GB":e>=1048576?(e/1048576).toFixed(2)+" MB":e>=1024?(e/1024).toFixed(2)+" KB":e+" B",_s=(e,t,r)=>{let n=e.path,o=Je.LocalPath;const s=window.URL.createObjectURL(e);return(t||!n)&&(n=s,o=Je.ObjectUrl),{path:n,name:e.name,source:o,cloud_source:r,ext:e.name.split(".").pop(),size:e.size,object_url:s,uid:Ss()}},vs=e=>new Date(e*1e3).toISOString().substring(11,19),Os=async()=>{const e=await un(),t=e.token;return{cos:new Fe({getAuthorization:function(r,n){n({TmpSecretId:t.TmpSecretId,TmpSecretKey:t.TmpSecretKey,XCosSecurityToken:t.Token,StartTime:e.start_time,ExpiredTime:e.end_time})},SliceSize:1024*1024*5}),path:e.path,bucket:e.bucket,region:e.region}},Cs=async()=>{const e=await Ls(),t=e.token;return{oss:new ao({region:e.region,accessKeyId:t.TmpSecretId,accessKeySecret:t.TmpSecretKey,stsToken:t.Token,bucket:e.bucket}),path:e.path,bucket:e.bucket,region:e.region}},on=e=>{const t=[];for(const r in e){const n=e[r];n&&t.push(`${r}=${n}`)}return t.join("&")},Ds=/\$(.*?)\$/g,Rs=(e,t)=>{let r;const n=[];for(;(r=Ds.exec(e))!==null;)r&&r.length>0&&n.push(r[1]);return n.map(o=>{const s=t[o];s&&(e=e.replace(`$${o}$`,o.split(".").length==2?s[o.split(".")[1]]:s))}),e},Ps=e=>Object.keys(e).filter(t=>e[t]).map(t=>{let r=e[t];return["string","number","boolean"].includes(typeof r)?r=String(r):r=JSON.stringify(r),`${t}=${encodeURIComponent(r)}`}).join("&"),xs=e=>new Promise((t,r)=>{const n=new XMLHttpRequest;n.open("get",e),n.responseType="blob",n.send(),n.onload=function(){(this.status===200||this.status===304)&&(sn(URL.createObjectURL(this.response)),t())},n.onerror=function(){r("下载失败,请在新窗口打开")}}),sn=(e,t)=>{var n;const r=document.createElement("a");r.style.display="none",r.href=e,t?r.download=t:r.download=((n=e.split("?").shift())==null?void 0:n.split("/").pop())||e,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(e)},K=process.env.NODE_ENV=="production"?"https://api.zyjj.cc/api/v1":"http://127.0.0.1:3000/api/v1",js=process.env.NODE_ENV=="production"?"https://knowledge.zyjj.cc/api/v1":"http://127.0.0.1:3001/api/v1",Ns=e=>J(`${K}/common/user/login`,e,"post"),ks=(e,t,r)=>J(`${K}/common/app/info?os=${e}&version=${t}&uid=${r||""}`,{},"get"),Is=e=>J(`${K}/common/user/register`,e,"post"),As=e=>J(`${K}/common/user/reset/password`,e,"post"),an=e=>J(`${K}/common/user/email/token`,{email:e},"post"),cn=()=>J(`${K}/user/user/info`,{},"get",!1),Fs=e=>J(`${K}/user/user/info`,e,"put"),Ms=e=>J(`${K}/user/point/deducting`,e,"post"),$s=e=>J(`${K}/common/tool/list?${on(e)}`,{},"get"),Us=()=>J(`${K}/common/tool/all`,{},"get"),Bs=e=>J(`${K}/common/tool/${e}`,{},"get"),zs=e=>J(`${K}/common/tool/inc/${e}`,{},"get"),Vs=()=>J(`${K}/common/tool/tags`,{},"get"),un=()=>J(`${K}/user/cloud/tencent/cos`,{},"get"),Ls=()=>J(`${K}/user/cloud/aliyun/oss`,{},"get"),qs=e=>J(`${K}/user/task`,e,"post"),Ts=e=>J(`${K}/user/task/${e}`,{},"get"),ln=()=>J(`${K}/user/cloud/mqtt/task`,{},"get"),Ws=()=>J(`${K}/common/material/tags`,{},"get"),Hs=e=>J(`${K}/user/material/${e}`,{},"get"),Gs=e=>J(`${K}/user/material/url`,{key_list:e},"post"),Ys=e=>J(`${K}${e.url}`,e.data||{},e.method),Js=e=>J(`${js}${e.url}`,e.data||{},e.method);var Vt;(function(e){e[e.Task=0]="Task",e[e.Lab=1]="Lab",e[e.Flow=2]="Flow"})(Vt||(Vt={}));var Lt;(function(e){e[e.Create=0]="Create",e[e.Progress=1]="Progress",e[e.Success=2]="Success",e[e.Error=3]="Error",e[e.Cancel=4]="Cancel"})(Lt||(Lt={}));var je;(function(e){e[e.Start=1]="Start",e[e.Progress=2]="Progress",e[e.Success=3]="Success",e[e.Error=4]="Error",e[e.DetailAppend=5]="DetailAppend",e[e.DetailSet=6]="DetailSet"})(je||(je={}));var qt;(function(e){e[e.FileInput=0]="FileInput",e[e.FileInputList=1]="FileInputList",e[e.Select=2]="Select",e[e.FileGenerate=3]="FileGenerate",e[e.Input=4]="Input",e[e.Alert=5]="Alert"})(qt||(qt={}));var Tt;(function(e){e[e.Ffmpeg=0]="Ffmpeg",e[e.Cloud=1]="Cloud",e[e.Download=2]="Download"})(Tt||(Tt={}));var Wt;(function(e){e[e.SubtitleEmbed=0]="SubtitleEmbed",e[e.NoVideo=1]="NoVideo",e[e.NoAudio=2]="NoAudio",e[e.AudioEncode=3]="AudioEncode",e[e.VideoEncode=4]="VideoEncode",e[e.MergeFile=5]="MergeFile",e[e.Format=6]="Format",e[e.AddOption=7]="AddOption",e[e.OutputOption=8]="OutputOption",e[e.InputOption=9]="InputOption"})(Wt||(Wt={}));var Ht;(function(e){e[e.Input=0]="Input",e[e.Select=1]="Select",e[e.TextArea=2]="TextArea",e[e.FileUpload=3]="FileUpload",e[e.Slider=4]="Slider",e[e.Audio=5]="Audio",e[e.Number=6]="Number",e[e.ImageList=7]="ImageList",e[e.Image=8]="Image",e[e.Alert=9]="Alert",e[e.Video=10]="Video",e[e.MarkDown=11]="MarkDown"})(Ht||(Ht={}));var Ks=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Gt={exports:{}},Ke={};/**
6
+ `+s):n.stack=s}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=$e(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:s}=r;n!==void 0&&It.assertOptions(n,{silentJSONParsing:De.transitional(De.boolean),forcedJSONParsing:De.transitional(De.boolean),clarifyTimeoutError:De.transitional(De.boolean)},!1),o!=null&&(h.isFunction(o)?r.paramsSerializer={serialize:o}:It.assertOptions(o,{encode:De.function,serialize:De.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=s&&h.merge(s.common,s[r.method]);s&&h.forEach(["delete","get","head","post","put","patch","common"],m=>{delete s[m]}),r.headers=he.concat(i,s);const c=[];let u=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(r)===!1||(u=u&&b.synchronous,c.unshift(b.fulfilled,b.rejected))});const d=[];this.interceptors.response.forEach(function(b){d.push(b.fulfilled,b.rejected)});let f,l=0,E;if(!u){const m=[Zr.bind(this),void 0];for(m.unshift.apply(m,c),m.push.apply(m,d),E=m.length,f=Promise.resolve(r);l<E;)f=f.then(m[l++],m[l++]);return f}E=c.length;let C=r;for(l=0;l<E;){const m=c[l++],b=c[l++];try{C=m(C)}catch(k){b.call(this,k);break}}try{f=Zr.call(this,C)}catch(m){return Promise.reject(m)}for(l=0,E=d.length;l<E;)f=f.then(d[l++],d[l++]);return f}getUri(t){t=$e(this.defaults,t);const r=Yr(t.baseURL,t.url);return Vr(r,t.params,t.paramsSerializer)}}h.forEach(["delete","get","head","options"],function(t){xe.prototype[t]=function(r,n){return this.request($e(n||{},{method:t,url:r,data:(n||{}).data}))}}),h.forEach(["post","put","patch"],function(t){function r(n){return function(s,i,c){return this.request($e(c||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}xe.prototype[t]=r(),xe.prototype[t+"Form"]=r(!0)});class At{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});const n=this;this.promise.then(o=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](o);n._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(c=>{n.subscribe(c),s=c}).then(o);return i.cancel=function(){n.unsubscribe(s)},i},t(function(s,i,c){n.reason||(n.reason=new Ge(s,i,c),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}static source(){let t;return{token:new At(function(o){t=o}),cancel:t}}}function ms(e){return function(r){return e.apply(null,r)}}function ys(e){return h.isObject(e)&&e.isAxiosError===!0}const Ft={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ft).forEach(([e,t])=>{Ft[t]=e});function rn(e){const t=new xe(e),r=Cr(xe.prototype.request,t);return h.extend(r,xe.prototype,t,{allOwnKeys:!0}),h.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return rn($e(e,o))},r}const H=rn(We);H.Axios=xe,H.CanceledError=Ge,H.CancelToken=At,H.isCancel=Gr,H.VERSION=en,H.toFormData=it,H.AxiosError=F,H.Cancel=H.CanceledError,H.all=function(t){return Promise.all(t)},H.spread=ms,H.isAxiosError=ys,H.mergeConfig=$e,H.AxiosHeaders=he,H.formToJSON=e=>Wr(h.isHTMLForm(e)?new FormData(e):e),H.getAdapter=Xr.getAdapter,H.HttpStatusCode=Ft,H.default=H;const Ye=()=>localStorage.getItem("token");async function J(e,t,r,n=!0){let o;return r==="get"?o=H.get(e,{params:t,timeout:1e3*60*10,headers:{Authorization:Ye()}}):r==="post"?o=H.post(e,t,{headers:{Authorization:Ye()}}):r==="put"?o=H.put(e,t,{headers:{Authorization:Ye()}}):r==="delete"?o=H.delete(e,{params:t,headers:{Authorization:Ye()}}):r==="patch"&&(o=H.patch(e,t,{headers:{Authorization:Ye()}})),new Promise((s,i)=>{o.then(c=>{c.data.code!==0?(n&&_.Message.error(c.data.msg),i(c.data.msg)):s(c.data.data)}).catch(c=>{var u;((u=c.response)==null?void 0:u.status)==401?n&&_.Message.error("你的账户已过期,请重新登录"):n&&_.Message.error("请求失败"),console.log("请求失败",c),i("请求失败")})})}let ct;const gs=new Uint8Array(16);function bs(){if(!ct&&(ct=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ct))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ct(gs)}const se=[];for(let e=0;e<256;++e)se.push((e+256).toString(16).slice(1));function ws(e,t=0){return se[e[t+0]]+se[e[t+1]]+se[e[t+2]]+se[e[t+3]]+"-"+se[e[t+4]]+se[e[t+5]]+"-"+se[e[t+6]]+se[e[t+7]]+"-"+se[e[t+8]]+se[e[t+9]]+"-"+se[e[t+10]]+se[e[t+11]]+se[e[t+12]]+se[e[t+13]]+se[e[t+14]]+se[e[t+15]]}const nn={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Ss(e,t,r){if(nn.randomUUID&&!t&&!e)return nn.randomUUID();e=e||{};const n=e.random||(e.rng||bs)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,ws(n)}var Je;(function(e){e[e.LocalPath=0]="LocalPath",e[e.TencentCos=1]="TencentCos",e[e.ObjectUrl=2]="ObjectUrl",e[e.AliYunOss=3]="AliYunOss"})(Je||(Je={}));var Mt;(function(e){e[e.TaskAction=0]="TaskAction",e[e.WorkAction=1]="WorkAction",e[e.MqttSend=3]="MqttSend",e[e.ActionClose=4]="ActionClose",e[e.MqttReconnect=5]="MqttReconnect",e[e.NavigateTo=7]="NavigateTo",e[e.OpenTool=10]="OpenTool",e[e.DownloadFile=11]="DownloadFile"})(Mt||(Mt={}));var $t;(function(e){e[e.TaskAction=0]="TaskAction",e[e.NavigateTo=3]="NavigateTo",e[e.OpenTool=6]="OpenTool",e[e.MqttBack=1]="MqttBack",e[e.ExtensionBlobUrl=4]="ExtensionBlobUrl",e[e.ExtensionId=5]="ExtensionId",e[e.UrlCallback=7]="UrlCallback",e[e.DownloadFileRes=8]="DownloadFileRes"})($t||($t={}));var Ut;(function(e){e.Waiting="等待",e.Running="进行",e.Fail="失败",e.Success="成功",e.Canceled="取消"})(Ut||(Ut={}));var Bt;(function(e){e[e.Start=1]="Start",e[e.Progress=2]="Progress",e[e.Success=3]="Success",e[e.Error=4]="Error",e[e.DetailAppend=5]="DetailAppend",e[e.DetailSet=6]="DetailSet"})(Bt||(Bt={}));var zt;(function(e){e[e.ChoosePic=-3]="ChoosePic",e[e.CostPoint=-4]="CostPoint",e[e.AddAction=-5]="AddAction",e[e.CloseWindow=-6]="CloseWindow",e[e.SendRequest=-7]="SendRequest",e[e.UploadFileByPath=-8]="UploadFileByPath",e[e.GetInitData=-9]="GetInitData"})(zt||(zt={}));const Es=e=>e>=1073741824?(e/1073741824).toFixed(2)+" GB":e>=1048576?(e/1048576).toFixed(2)+" MB":e>=1024?(e/1024).toFixed(2)+" KB":e+" B",_s=(e,t,r)=>{let n=e.path,o=Je.LocalPath;const s=window.URL.createObjectURL(e);return(t||!n)&&(n=s,o=Je.ObjectUrl),{path:n,name:e.name,source:o,cloud_source:r,ext:e.name.split(".").pop(),size:e.size,object_url:s,uid:Ss()}},vs=e=>new Date(e*1e3).toISOString().substring(11,19),Os=async()=>{const e=await un(),t=e.token;return{cos:new Fe({getAuthorization:function(r,n){n({TmpSecretId:t.TmpSecretId,TmpSecretKey:t.TmpSecretKey,XCosSecurityToken:t.Token,StartTime:e.start_time,ExpiredTime:e.end_time})},SliceSize:1024*1024*5}),path:e.path,bucket:e.bucket,region:e.region}},Cs=async()=>{const e=await Ls(),t=e.token;return{oss:new ao({region:e.region,accessKeyId:t.TmpSecretId,accessKeySecret:t.TmpSecretKey,stsToken:t.Token,bucket:e.bucket}),path:e.path,bucket:e.bucket,region:e.region}},on=e=>{const t=[];for(const r in e){const n=e[r];n&&t.push(`${r}=${n}`)}return t.join("&")},Ds=/\$(.*?)\$/g,Rs=(e,t)=>{let r;const n=[];for(;(r=Ds.exec(e))!==null;)r&&r.length>0&&n.push(r[1]);return n.map(o=>{const s=o.split(".");let i="";s.length==2?i=t[s[0]][s[1]]:i=t[o],i&&(e=e.replace(`$${o}$`,i))}),e},Ps=e=>Object.keys(e).filter(t=>e[t]).map(t=>{let r=e[t];return["string","number","boolean"].includes(typeof r)?r=String(r):r=JSON.stringify(r),`${t}=${encodeURIComponent(r)}`}).join("&"),xs=e=>new Promise((t,r)=>{const n=new XMLHttpRequest;n.open("get",e),n.responseType="blob",n.send(),n.onload=function(){(this.status===200||this.status===304)&&(sn(URL.createObjectURL(this.response)),t())},n.onerror=function(){r("下载失败,请在新窗口打开")}}),sn=(e,t)=>{var n;const r=document.createElement("a");r.style.display="none",r.href=e,t?r.download=t:r.download=((n=e.split("?").shift())==null?void 0:n.split("/").pop())||e,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(e)},K=process.env.NODE_ENV=="production"?"https://api.zyjj.cc/api/v1":"http://127.0.0.1:3000/api/v1",js=process.env.NODE_ENV=="production"?"https://knowledge.zyjj.cc/api/v1":"http://127.0.0.1:3001/api/v1",Ns=e=>J(`${K}/common/user/login`,e,"post"),ks=(e,t,r)=>J(`${K}/common/app/info?os=${e}&version=${t}&uid=${r||""}`,{},"get"),Is=e=>J(`${K}/common/user/register`,e,"post"),As=e=>J(`${K}/common/user/reset/password`,e,"post"),an=e=>J(`${K}/common/user/email/token`,{email:e},"post"),cn=()=>J(`${K}/user/user/info`,{},"get",!1),Fs=e=>J(`${K}/user/user/info`,e,"put"),Ms=e=>J(`${K}/user/point/deducting`,e,"post"),$s=e=>J(`${K}/common/tool/list?${on(e)}`,{},"get"),Us=()=>J(`${K}/common/tool/all`,{},"get"),Bs=e=>J(`${K}/common/tool/${e}`,{},"get"),zs=e=>J(`${K}/common/tool/inc/${e}`,{},"get"),Vs=()=>J(`${K}/common/tool/tags`,{},"get"),un=()=>J(`${K}/user/cloud/tencent/cos`,{},"get"),Ls=()=>J(`${K}/user/cloud/aliyun/oss`,{},"get"),qs=e=>J(`${K}/user/task`,e,"post"),Ts=e=>J(`${K}/user/task/${e}`,{},"get"),ln=()=>J(`${K}/user/cloud/mqtt/task`,{},"get"),Ws=()=>J(`${K}/common/material/tags`,{},"get"),Hs=e=>J(`${K}/user/material/${e}`,{},"get"),Gs=e=>J(`${K}/user/material/url`,{key_list:e},"post"),Ys=e=>J(`${K}${e.url}`,e.data||{},e.method),Js=e=>J(`${js}${e.url}`,e.data||{},e.method);var Vt;(function(e){e[e.Task=0]="Task",e[e.Lab=1]="Lab",e[e.Flow=2]="Flow",e[e.Custom=3]="Custom"})(Vt||(Vt={}));var Lt;(function(e){e[e.Create=0]="Create",e[e.Progress=1]="Progress",e[e.Success=2]="Success",e[e.Error=3]="Error",e[e.Cancel=4]="Cancel"})(Lt||(Lt={}));var je;(function(e){e[e.Start=1]="Start",e[e.Progress=2]="Progress",e[e.Success=3]="Success",e[e.Error=4]="Error",e[e.DetailAppend=5]="DetailAppend",e[e.DetailSet=6]="DetailSet"})(je||(je={}));var qt;(function(e){e[e.FileInput=0]="FileInput",e[e.FileInputList=1]="FileInputList",e[e.Select=2]="Select",e[e.FileGenerate=3]="FileGenerate",e[e.Input=4]="Input",e[e.Alert=5]="Alert"})(qt||(qt={}));var Tt;(function(e){e[e.Ffmpeg=0]="Ffmpeg",e[e.Cloud=1]="Cloud",e[e.Download=2]="Download"})(Tt||(Tt={}));var Wt;(function(e){e[e.SubtitleEmbed=0]="SubtitleEmbed",e[e.NoVideo=1]="NoVideo",e[e.NoAudio=2]="NoAudio",e[e.AudioEncode=3]="AudioEncode",e[e.VideoEncode=4]="VideoEncode",e[e.MergeFile=5]="MergeFile",e[e.Format=6]="Format",e[e.AddOption=7]="AddOption",e[e.OutputOption=8]="OutputOption",e[e.InputOption=9]="InputOption"})(Wt||(Wt={}));var Ht;(function(e){e[e.Input=0]="Input",e[e.Select=1]="Select",e[e.TextArea=2]="TextArea",e[e.FileUpload=3]="FileUpload",e[e.Slider=4]="Slider",e[e.Audio=5]="Audio",e[e.Number=6]="Number",e[e.ImageList=7]="ImageList",e[e.Image=8]="Image",e[e.Alert=9]="Alert",e[e.Video=10]="Video",e[e.MarkDown=11]="MarkDown"})(Ht||(Ht={}));var Ks=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Gt={exports:{}},Ke={};/**
7
7
  * @license React
8
8
  * react-jsx-runtime.production.min.js
9
9
  *
@@ -39,7 +39,8 @@ export interface ToolInfo {
39
39
  export declare enum ToolType {
40
40
  Task = 0,// 任务类型
41
41
  Lab = 1,// 实验室
42
- Flow = 2
42
+ Flow = 2,// 流程
43
+ Custom = 3
43
44
  }
44
45
  export interface ToolDetailInfo {
45
46
  tool_id?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zyjj-web-sdk",
3
- "version": "1.1.26",
3
+ "version": "1.1.27",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "lib"