@ibiz-template/core 0.1.33 → 0.1.36

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.esm.js CHANGED
@@ -383,6 +383,199 @@ var require_loglevel_plugin_prefix = __commonJS({
383
383
  }
384
384
  });
385
385
 
386
+ // ../../node_modules/.pnpm/@microsoft+fetch-event-source@2.0.1/node_modules/@microsoft/fetch-event-source/lib/esm/parse.js
387
+ async function getBytes(stream, onChunk) {
388
+ const reader = stream.getReader();
389
+ let result;
390
+ while (!(result = await reader.read()).done) {
391
+ onChunk(result.value);
392
+ }
393
+ }
394
+ function getLines(onLine) {
395
+ let buffer;
396
+ let position;
397
+ let fieldLength;
398
+ let discardTrailingNewline = false;
399
+ return function onChunk(arr) {
400
+ if (buffer === void 0) {
401
+ buffer = arr;
402
+ position = 0;
403
+ fieldLength = -1;
404
+ } else {
405
+ buffer = concat(buffer, arr);
406
+ }
407
+ const bufLength = buffer.length;
408
+ let lineStart = 0;
409
+ while (position < bufLength) {
410
+ if (discardTrailingNewline) {
411
+ if (buffer[position] === 10) {
412
+ lineStart = ++position;
413
+ }
414
+ discardTrailingNewline = false;
415
+ }
416
+ let lineEnd = -1;
417
+ for (; position < bufLength && lineEnd === -1; ++position) {
418
+ switch (buffer[position]) {
419
+ case 58:
420
+ if (fieldLength === -1) {
421
+ fieldLength = position - lineStart;
422
+ }
423
+ break;
424
+ case 13:
425
+ discardTrailingNewline = true;
426
+ case 10:
427
+ lineEnd = position;
428
+ break;
429
+ }
430
+ }
431
+ if (lineEnd === -1) {
432
+ break;
433
+ }
434
+ onLine(buffer.subarray(lineStart, lineEnd), fieldLength);
435
+ lineStart = position;
436
+ fieldLength = -1;
437
+ }
438
+ if (lineStart === bufLength) {
439
+ buffer = void 0;
440
+ } else if (lineStart !== 0) {
441
+ buffer = buffer.subarray(lineStart);
442
+ position -= lineStart;
443
+ }
444
+ };
445
+ }
446
+ function getMessages(onId, onRetry, onMessage) {
447
+ let message = newMessage();
448
+ const decoder = new TextDecoder();
449
+ return function onLine(line, fieldLength) {
450
+ if (line.length === 0) {
451
+ onMessage === null || onMessage === void 0 ? void 0 : onMessage(message);
452
+ message = newMessage();
453
+ } else if (fieldLength > 0) {
454
+ const field = decoder.decode(line.subarray(0, fieldLength));
455
+ const valueOffset = fieldLength + (line[fieldLength + 1] === 32 ? 2 : 1);
456
+ const value = decoder.decode(line.subarray(valueOffset));
457
+ switch (field) {
458
+ case "data":
459
+ message.data = message.data ? message.data + "\n" + value : value;
460
+ break;
461
+ case "event":
462
+ message.event = value;
463
+ break;
464
+ case "id":
465
+ onId(message.id = value);
466
+ break;
467
+ case "retry":
468
+ const retry = parseInt(value, 10);
469
+ if (!isNaN(retry)) {
470
+ onRetry(message.retry = retry);
471
+ }
472
+ break;
473
+ }
474
+ }
475
+ };
476
+ }
477
+ function concat(a, b) {
478
+ const res = new Uint8Array(a.length + b.length);
479
+ res.set(a);
480
+ res.set(b, a.length);
481
+ return res;
482
+ }
483
+ function newMessage() {
484
+ return {
485
+ data: "",
486
+ event: "",
487
+ id: "",
488
+ retry: void 0
489
+ };
490
+ }
491
+
492
+ // ../../node_modules/.pnpm/@microsoft+fetch-event-source@2.0.1/node_modules/@microsoft/fetch-event-source/lib/esm/fetch.js
493
+ var __rest = function(s, e) {
494
+ var t = {};
495
+ for (var p in s)
496
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
497
+ t[p] = s[p];
498
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
499
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
500
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
501
+ t[p[i]] = s[p[i]];
502
+ }
503
+ return t;
504
+ };
505
+ var EventStreamContentType = "text/event-stream";
506
+ var DefaultRetryInterval = 1e3;
507
+ var LastEventId = "last-event-id";
508
+ function fetchEventSource(input, _a) {
509
+ var { signal: inputSignal, headers: inputHeaders, onopen: inputOnOpen, onmessage, onclose, onerror, openWhenHidden, fetch: inputFetch } = _a, rest = __rest(_a, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
510
+ return new Promise((resolve, reject) => {
511
+ const headers = Object.assign({}, inputHeaders);
512
+ if (!headers.accept) {
513
+ headers.accept = EventStreamContentType;
514
+ }
515
+ let curRequestController;
516
+ function onVisibilityChange() {
517
+ curRequestController.abort();
518
+ if (!document.hidden) {
519
+ create();
520
+ }
521
+ }
522
+ if (!openWhenHidden) {
523
+ document.addEventListener("visibilitychange", onVisibilityChange);
524
+ }
525
+ let retryInterval = DefaultRetryInterval;
526
+ let retryTimer = 0;
527
+ function dispose() {
528
+ document.removeEventListener("visibilitychange", onVisibilityChange);
529
+ window.clearTimeout(retryTimer);
530
+ curRequestController.abort();
531
+ }
532
+ inputSignal === null || inputSignal === void 0 ? void 0 : inputSignal.addEventListener("abort", () => {
533
+ dispose();
534
+ resolve();
535
+ });
536
+ const fetch = inputFetch !== null && inputFetch !== void 0 ? inputFetch : window.fetch;
537
+ const onopen = inputOnOpen !== null && inputOnOpen !== void 0 ? inputOnOpen : defaultOnOpen;
538
+ async function create() {
539
+ var _a2;
540
+ curRequestController = new AbortController();
541
+ try {
542
+ const response = await fetch(input, Object.assign(Object.assign({}, rest), { headers, signal: curRequestController.signal }));
543
+ await onopen(response);
544
+ await getBytes(response.body, getLines(getMessages((id) => {
545
+ if (id) {
546
+ headers[LastEventId] = id;
547
+ } else {
548
+ delete headers[LastEventId];
549
+ }
550
+ }, (retry) => {
551
+ retryInterval = retry;
552
+ }, onmessage)));
553
+ onclose === null || onclose === void 0 ? void 0 : onclose();
554
+ dispose();
555
+ resolve();
556
+ } catch (err) {
557
+ if (!curRequestController.signal.aborted) {
558
+ try {
559
+ const interval = (_a2 = onerror === null || onerror === void 0 ? void 0 : onerror(err)) !== null && _a2 !== void 0 ? _a2 : retryInterval;
560
+ window.clearTimeout(retryTimer);
561
+ retryTimer = window.setTimeout(create, interval);
562
+ } catch (innerErr) {
563
+ dispose();
564
+ reject(innerErr);
565
+ }
566
+ }
567
+ }
568
+ }
569
+ create();
570
+ });
571
+ }
572
+ function defaultOnOpen(response) {
573
+ const contentType = response.headers.get("content-type");
574
+ if (!(contentType === null || contentType === void 0 ? void 0 : contentType.startsWith(EventStreamContentType))) {
575
+ throw new Error("Expected content-type to be ".concat(EventStreamContentType, ", Actual: ").concat(contentType));
576
+ }
577
+ }
578
+
386
579
  // src/command/utils/linked-list.ts
387
580
  var _Node = class _Node {
388
581
  constructor(element) {
@@ -1160,6 +1353,10 @@ function toNumberOrNil(value) {
1160
1353
  }
1161
1354
  return num;
1162
1355
  }
1356
+ var SvgPattern = /<svg\b[^>]*>[\s\S]*?<\/svg>/;
1357
+ function isSvg(str) {
1358
+ return SvgPattern.test(str);
1359
+ }
1163
1360
 
1164
1361
  // src/utils/interceptor/interceptor.ts
1165
1362
  var Interceptor = class {
@@ -1808,201 +2005,6 @@ var HttpResponse = class {
1808
2005
 
1809
2006
  // src/utils/net/net.ts
1810
2007
  import axios from "axios";
1811
-
1812
- // ../../node_modules/.pnpm/@microsoft+fetch-event-source@2.0.1/node_modules/@microsoft/fetch-event-source/lib/esm/parse.js
1813
- async function getBytes(stream, onChunk) {
1814
- const reader = stream.getReader();
1815
- let result;
1816
- while (!(result = await reader.read()).done) {
1817
- onChunk(result.value);
1818
- }
1819
- }
1820
- function getLines(onLine) {
1821
- let buffer;
1822
- let position;
1823
- let fieldLength;
1824
- let discardTrailingNewline = false;
1825
- return function onChunk(arr) {
1826
- if (buffer === void 0) {
1827
- buffer = arr;
1828
- position = 0;
1829
- fieldLength = -1;
1830
- } else {
1831
- buffer = concat(buffer, arr);
1832
- }
1833
- const bufLength = buffer.length;
1834
- let lineStart = 0;
1835
- while (position < bufLength) {
1836
- if (discardTrailingNewline) {
1837
- if (buffer[position] === 10) {
1838
- lineStart = ++position;
1839
- }
1840
- discardTrailingNewline = false;
1841
- }
1842
- let lineEnd = -1;
1843
- for (; position < bufLength && lineEnd === -1; ++position) {
1844
- switch (buffer[position]) {
1845
- case 58:
1846
- if (fieldLength === -1) {
1847
- fieldLength = position - lineStart;
1848
- }
1849
- break;
1850
- case 13:
1851
- discardTrailingNewline = true;
1852
- case 10:
1853
- lineEnd = position;
1854
- break;
1855
- }
1856
- }
1857
- if (lineEnd === -1) {
1858
- break;
1859
- }
1860
- onLine(buffer.subarray(lineStart, lineEnd), fieldLength);
1861
- lineStart = position;
1862
- fieldLength = -1;
1863
- }
1864
- if (lineStart === bufLength) {
1865
- buffer = void 0;
1866
- } else if (lineStart !== 0) {
1867
- buffer = buffer.subarray(lineStart);
1868
- position -= lineStart;
1869
- }
1870
- };
1871
- }
1872
- function getMessages(onId, onRetry, onMessage) {
1873
- let message = newMessage();
1874
- const decoder = new TextDecoder();
1875
- return function onLine(line, fieldLength) {
1876
- if (line.length === 0) {
1877
- onMessage === null || onMessage === void 0 ? void 0 : onMessage(message);
1878
- message = newMessage();
1879
- } else if (fieldLength > 0) {
1880
- const field = decoder.decode(line.subarray(0, fieldLength));
1881
- const valueOffset = fieldLength + (line[fieldLength + 1] === 32 ? 2 : 1);
1882
- const value = decoder.decode(line.subarray(valueOffset));
1883
- switch (field) {
1884
- case "data":
1885
- message.data = message.data ? message.data + "\n" + value : value;
1886
- break;
1887
- case "event":
1888
- message.event = value;
1889
- break;
1890
- case "id":
1891
- onId(message.id = value);
1892
- break;
1893
- case "retry":
1894
- const retry = parseInt(value, 10);
1895
- if (!isNaN(retry)) {
1896
- onRetry(message.retry = retry);
1897
- }
1898
- break;
1899
- }
1900
- }
1901
- };
1902
- }
1903
- function concat(a, b) {
1904
- const res = new Uint8Array(a.length + b.length);
1905
- res.set(a);
1906
- res.set(b, a.length);
1907
- return res;
1908
- }
1909
- function newMessage() {
1910
- return {
1911
- data: "",
1912
- event: "",
1913
- id: "",
1914
- retry: void 0
1915
- };
1916
- }
1917
-
1918
- // ../../node_modules/.pnpm/@microsoft+fetch-event-source@2.0.1/node_modules/@microsoft/fetch-event-source/lib/esm/fetch.js
1919
- var __rest = function(s, e) {
1920
- var t = {};
1921
- for (var p in s)
1922
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1923
- t[p] = s[p];
1924
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
1925
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1926
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1927
- t[p[i]] = s[p[i]];
1928
- }
1929
- return t;
1930
- };
1931
- var EventStreamContentType = "text/event-stream";
1932
- var DefaultRetryInterval = 1e3;
1933
- var LastEventId = "last-event-id";
1934
- function fetchEventSource(input, _a) {
1935
- var { signal: inputSignal, headers: inputHeaders, onopen: inputOnOpen, onmessage, onclose, onerror, openWhenHidden, fetch: inputFetch } = _a, rest = __rest(_a, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
1936
- return new Promise((resolve, reject) => {
1937
- const headers = Object.assign({}, inputHeaders);
1938
- if (!headers.accept) {
1939
- headers.accept = EventStreamContentType;
1940
- }
1941
- let curRequestController;
1942
- function onVisibilityChange() {
1943
- curRequestController.abort();
1944
- if (!document.hidden) {
1945
- create();
1946
- }
1947
- }
1948
- if (!openWhenHidden) {
1949
- document.addEventListener("visibilitychange", onVisibilityChange);
1950
- }
1951
- let retryInterval = DefaultRetryInterval;
1952
- let retryTimer = 0;
1953
- function dispose() {
1954
- document.removeEventListener("visibilitychange", onVisibilityChange);
1955
- window.clearTimeout(retryTimer);
1956
- curRequestController.abort();
1957
- }
1958
- inputSignal === null || inputSignal === void 0 ? void 0 : inputSignal.addEventListener("abort", () => {
1959
- dispose();
1960
- resolve();
1961
- });
1962
- const fetch = inputFetch !== null && inputFetch !== void 0 ? inputFetch : window.fetch;
1963
- const onopen = inputOnOpen !== null && inputOnOpen !== void 0 ? inputOnOpen : defaultOnOpen;
1964
- async function create() {
1965
- var _a2;
1966
- curRequestController = new AbortController();
1967
- try {
1968
- const response = await fetch(input, Object.assign(Object.assign({}, rest), { headers, signal: curRequestController.signal }));
1969
- await onopen(response);
1970
- await getBytes(response.body, getLines(getMessages((id) => {
1971
- if (id) {
1972
- headers[LastEventId] = id;
1973
- } else {
1974
- delete headers[LastEventId];
1975
- }
1976
- }, (retry) => {
1977
- retryInterval = retry;
1978
- }, onmessage)));
1979
- onclose === null || onclose === void 0 ? void 0 : onclose();
1980
- dispose();
1981
- resolve();
1982
- } catch (err) {
1983
- if (!curRequestController.signal.aborted) {
1984
- try {
1985
- const interval = (_a2 = onerror === null || onerror === void 0 ? void 0 : onerror(err)) !== null && _a2 !== void 0 ? _a2 : retryInterval;
1986
- window.clearTimeout(retryTimer);
1987
- retryTimer = window.setTimeout(create, interval);
1988
- } catch (innerErr) {
1989
- dispose();
1990
- reject(innerErr);
1991
- }
1992
- }
1993
- }
1994
- }
1995
- create();
1996
- });
1997
- }
1998
- function defaultOnOpen(response) {
1999
- const contentType = response.headers.get("content-type");
2000
- if (!(contentType === null || contentType === void 0 ? void 0 : contentType.startsWith(EventStreamContentType))) {
2001
- throw new Error("Expected content-type to be ".concat(EventStreamContentType, ", Actual: ").concat(contentType));
2002
- }
2003
- }
2004
-
2005
- // src/utils/net/net.ts
2006
2008
  import { merge } from "lodash-es";
2007
2009
  import { stringify } from "qs";
2008
2010
  import { notNilEmpty } from "qx-util";
@@ -2294,15 +2296,14 @@ var Net = class {
2294
2296
  }
2295
2297
  headers.srfsystemid = systemId;
2296
2298
  }
2297
- await fetchEventSource(
2298
- url,
2299
- mergeDeepRight(
2300
- {
2301
- method: "POST"
2302
- },
2303
- options
2304
- )
2299
+ const config = mergeDeepRight(
2300
+ {
2301
+ openWhenHidden: true,
2302
+ method: "POST"
2303
+ },
2304
+ options
2305
2305
  );
2306
+ await fetchEventSource(url, config);
2306
2307
  }
2307
2308
  /**
2308
2309
  * 统一处理请求返回
@@ -3155,6 +3156,7 @@ export {
3155
3156
  CountLatch,
3156
3157
  DataTypes,
3157
3158
  Environment,
3159
+ EventStreamContentType,
3158
3160
  HttpError,
3159
3161
  HttpResponse,
3160
3162
  HttpStatusMessageConst,
@@ -3184,6 +3186,7 @@ export {
3184
3186
  debounceAndMerge,
3185
3187
  downloadFileFromBlob,
3186
3188
  eventPath,
3189
+ fetchEventSource,
3187
3190
  fileListToArr,
3188
3191
  findRecursiveChild,
3189
3192
  getToken,
@@ -3192,6 +3195,7 @@ export {
3192
3195
  isEventInside,
3193
3196
  isImage,
3194
3197
  isOverlap,
3198
+ isSvg,
3195
3199
  listenJSEvent,
3196
3200
  mergeDefaultInLeft,
3197
3201
  mergeInLeft,
@@ -1,2 +1,2 @@
1
- System.register(["ramda","lodash-es","qx-util","axios","qs"],(function(e){"use strict";var t,n,s,r,o,i,a,c,l,u,h,d,p,f,m;return{setters:[function(e){t=e.clone,n=e.isNotNil,s=e.isNil,r=e.mergeDeepRight},function(e){o=e.debounce,i=e.merge,a=e.uniqueId,e.round,e.cloneDeep,c=e.isFunction},function(e){l=e.getCookie,u=e.notNilEmpty,h=e.createUUID,d=e.QXEvent},function(e){p=e.AxiosHeaders,f=e.default},function(e){m=e.stringify}],execute:function(){e({awaitTimeout:async function(e,t,n){if(await new Promise((t=>{setTimeout((()=>{t(!0)}),e)})),t)return t(...n||[])},calcMimeByFileName:pe,colorBlend:function(e,t,n=.5,s="hex"){e=e.trim(),t=t.trim();const r=de(e),o=de(t),i=[he((1-n)*r[0]+n*o[0]),he((1-n)*r[1]+n*o[1]),he((1-n)*r[2]+n*o[2]),(1-n)*r[3]+n*o[3]];if("hex"===s){const e=[i[0].toString(16),i[1].toString(16),i[2].toString(16),0===i[3]?"00":he(255*i[3]).toString(16)];return"#".concat(e[0]).concat(e[1]).concat(e[2]).concat(e[3])}return"rgb(".concat(i[0]," ").concat(i[1]," ").concat(i[2]," / ").concat(i[3],")")},compareArr:function(e,t,n){const s=new Set([...e,...t]),r=[],o=[],i=[];if(n){const a=e.map((e=>e[n])),c=t.map((e=>e[n]));s.forEach((e=>{a.includes(e[n])?c.includes(e[n])?i.push(e):r.push(e):o.push(e)}))}else s.forEach((n=>{e.includes(n)?t.includes(n)?i.push(n):r.push(n):o.push(n)}));return{more:r,less:o,same:i}},debounce:function(e,t,n){let s;return function(...r){if(s&&clearTimeout(s),n){const n=!s;s=setTimeout((()=>{s=null}),t),n&&e.apply(this,r)}else s=setTimeout((()=>{e.apply(this,r)}),t)}},debounceAndAsyncMerge:function(e,t,n){let s,r=[];const i=o((async(...t)=>{s=void 0;try{const n=await e(...t);return r.forEach((e=>{e.resolve(n)})),r=[],n}catch(e){r.forEach((t=>{t.reject(e)})),r=[]}}),n);return async(...e)=>{let n=e;return s&&(n=t(s,n)),s=n,i(...n),new Promise(((e,t)=>{r.push({resolve:e,reject:t})}))}},debounceAndMerge:function(e,t,n){let s;const r=o(((...t)=>(s=void 0,e(...t))),n);return(...e)=>{let n=e;return s&&(n=t(s,n)),s=n,r(...n)}},downloadFileFromBlob:function(e,t){const n=pe(t),s=new Blob([e],{type:n}),r=URL.createObjectURL(s),o=document.createElement("a");o.href=r,o.download=t,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(r)},eventPath:ae,fileListToArr:fe,findRecursiveChild:function(e,t,n){const{compareField:s,compareCallback:o}=r(ve,n||{}),i=o||(e=>e[s]===t);let a;return ye(e,(e=>{if(i(e,t,s))return a=e,!0}),n),a},getToken:z,install:function(){if(window.ibiz)throw new Error("ibiz 已经存在, 无需重复安装");window.ibiz=new Re},isElementSame:function(e,t,n){if(e.length!==t.length)return!1;const s=n?[...e.map((e=>e[n])),...t.map((e=>e[n]))]:[...e,...t];return Array.from(new Set(s)).length===e.length},isEventInside:le,isImage:function(e){const t=e.split(".").pop();if(!t)return!1;return[".jpeg","jpg","gif","png","bmp","svg"].includes(t)},isOverlap:function(e,t){return Array.from(new Set([...e,...t])).length!==e.length+t.length},listenJSEvent:ce,mergeDefaultInLeft:function(e,t){Object.keys(t).forEach((r=>{n(t[r])&&s(e[r])&&(e[r]=t[r])}))},mergeInLeft:function(e,t){Object.keys(t).forEach((s=>{n(t[s])&&(e[s]=t[s])}))},onClickOutside:function(e,t,n={}){const{window:s=ue,ignore:r=[],capture:o=!0}=n;if(!e)throw new F("target元素不存在");if(!s)throw new F("找不到window");let i=!0;const a=t=>![e,...r].some((e=>le(t,e)));let c=!1;let l;const u=e=>{c||(s.clearTimeout(l),i&&a(e)&&t(e))},h=[ce(s,"click",u,{passive:!0,capture:o}),ce(s,"pointerdown",(e=>{c||(i=a(e))}),{passive:!0}),ce(s,"pointerup",(e=>{if(!c&&0===e.button){const t=ae(e);e.composedPath=()=>t,l=s.setTimeout((()=>u(e)),50)}}),{passive:!0})].filter(Boolean);return{stop:()=>h.forEach((e=>e())),pause:()=>{c=!0},proceed:()=>{c=!1}}},recursiveIterate:ye,selectFile:me,setRemoteStyle:async function(e){try{const t=await ibiz.net.get(e),n=document.createElement("style");n.setAttribute("title","app-style-css"),n.innerText=t.data,document.head.appendChild(n)}catch(t){ibiz.log.debug("加载远程样式表失败",e)}},throttle:function(e,t){let n=null;return function(...s){n||(n=setTimeout((()=>{e.apply(this,s),n=null}),t))}},toDisposable:_,toNumberOrNil:function(e){if(s(e))return;const t=Number(e);if(Number.isNaN(t))return;return t},uploadFile:function(e){const t=i({multiple:!0,accept:"",separate:!0,beforeUpload:(e,t)=>!0,finish:e=>{},success:(e,t)=>{},error:(e,t)=>{},progress:e=>{}},e),n=async e=>{const n=e.map((e=>({status:"uploading",name:e.name,uid:a(),percentage:0})));if(!t.beforeUpload(e,n))return n.forEach((e=>{e.status="cancel"})),ibiz.log.debug("取消上传",n),n;try{const s=await(async(e,n)=>{if(t.request&&c(t.request))return t.request(e);const s=new FormData;throw e.forEach((e=>{s.append("file",e)})),new F("多应用模式等待重新实现请求")})(e);n.forEach((e=>{e.status="finished"})),t.success(n,s),n.forEach((e=>{e.response=s}))}catch(s){n.forEach((e=>{e.status="fail"})),t.error(n,s),n.forEach((e=>{e.error=s})),ibiz.log.error(s),ibiz.log.error("".concat(e.map((e=>e.name)).join(","),"上传失败"))}return n};me({accept:t.accept,multiple:t.multiple,onSelected:e=>{(async e=>{const s=t.separate?e.map((e=>[e])):[e],r=await Promise.allSettled(s.map((async e=>n(e)))),o=[];r.forEach((e=>{"fulfilled"===e.status&&o.push(...e.value)})),t.finish(o)})(e)}})}});var g=Object.create,w=Object.defineProperty,y=Object.getOwnPropertyDescriptor,v=Object.getOwnPropertyNames,b=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty,x=(e,t)=>function(){return t||(0,e[v(e)[0]])((t={exports:{}}).exports,t),t.exports},R=(e,t,n)=>(n=null!=e?g(b(e)):{},((e,t,n,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of v(t))E.call(e,r)||r===n||w(e,r,{get:()=>t[r],enumerable:!(s=y(t,r))||s.enumerable});return e})(!t&&e&&e.__esModule?n:w(n,"default",{value:e,enumerable:!0}),e)),O=x({"../../node_modules/.pnpm/loglevel@1.8.1/node_modules/loglevel/lib/loglevel.js"(e,t){var n,s;n=e,s=function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),s=["trace","debug","info","warn","error"];function r(e,t){var n=e[t];if("function"==typeof n.bind)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch(t){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function o(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function i(t,n){for(var r=0;r<s.length;r++){var o=s[r];this[o]=r<t?e:this.methodFactory(o,t,n)}this.log=this.debug}function a(e,n,s){return function(){typeof console!==t&&(i.call(this,n,s),this[e].apply(this,arguments))}}function c(s,i,c){return function(s){return"debug"===s&&(s="log"),typeof console!==t&&("trace"===s&&n?o:void 0!==console[s]?r(console,s):void 0!==console.log?r(console,"log"):e)}(s)||a.apply(this,arguments)}function l(e,n,r){var o,a=this;n=null==n?"WARN":n;var l="loglevel";function u(){var e;if(typeof window!==t&&l){try{e=window.localStorage[l]}catch(e){}if(typeof e===t)try{var n=window.document.cookie,s=n.indexOf(encodeURIComponent(l)+"=");-1!==s&&(e=/^([^;]+)/.exec(n.slice(s))[1])}catch(e){}return void 0===a.levels[e]&&(e=void 0),e}}"string"==typeof e?l+=":"+e:"symbol"==typeof e&&(l=void 0),a.name=e,a.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},a.methodFactory=r||c,a.getLevel=function(){return o},a.setLevel=function(n,r){if("string"==typeof n&&void 0!==a.levels[n.toUpperCase()]&&(n=a.levels[n.toUpperCase()]),!("number"==typeof n&&n>=0&&n<=a.levels.SILENT))throw"log.setLevel() called with invalid level: "+n;if(o=n,!1!==r&&function(e){var n=(s[e]||"silent").toUpperCase();if(typeof window!==t&&l){try{return void(window.localStorage[l]=n)}catch(e){}try{window.document.cookie=encodeURIComponent(l)+"="+n+";"}catch(e){}}}(n),i.call(a,n,e),typeof console===t&&n<a.levels.SILENT)return"No console available for logging"},a.setDefaultLevel=function(e){n=e,u()||a.setLevel(e,!1)},a.resetLevel=function(){a.setLevel(n,!1),function(){if(typeof window!==t&&l){try{return void window.localStorage.removeItem(l)}catch(e){}try{window.document.cookie=encodeURIComponent(l)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}()},a.enableAll=function(e){a.setLevel(a.levels.TRACE,e)},a.disableAll=function(e){a.setLevel(a.levels.SILENT,e)};var h=u();null==h&&(h=n),a.setLevel(h,!1)}var u=new l,h={};u.getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=h[e];return t||(t=h[e]=new l(e,u.getLevel(),u.methodFactory)),t};var d=typeof window!==t?window.log:void 0;return u.noConflict=function(){return typeof window!==t&&window.log===u&&(window.log=d),u},u.getLoggers=function(){return h},u.default=u,u},"function"==typeof define&&define.amd?define(s):"object"==typeof t&&t.exports?t.exports=s():n.log=s()}}),T=x({"../../node_modules/.pnpm/loglevel-plugin-prefix@0.8.4/node_modules/loglevel-plugin-prefix/lib/loglevel-plugin-prefix.js"(e,t){var n,s;n=e,s=function(e){var t,n,s={template:"[%t] %l:",levelFormatter:function(e){return e.toUpperCase()},nameFormatter:function(e){return e||"root"},timestampFormatter:function(e){return e.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/,"$1")},format:void 0},r={},o={reg:function(e){if(!e||!e.getLogger)throw new TypeError("Argument is not a root logger");t=e},apply:function(e,n){if(!e||!e.setLevel)throw new TypeError("Argument is not a logger");var o=e.methodFactory,i=e.name||"",a=r[i]||r[""]||s;return r[i]||(e.methodFactory=function(e,t,n){var s=o(e,t,n),a=r[n]||r[""],c=-1!==a.template.indexOf("%t"),l=-1!==a.template.indexOf("%l"),u=-1!==a.template.indexOf("%n");return function(){for(var t="",o=arguments.length,h=Array(o),d=0;d<o;d++)h[d]=arguments[d];if(i||!r[n]){var p=a.timestampFormatter(new Date),f=a.levelFormatter(e),m=a.nameFormatter(n);a.format?t+=a.format(f,m,p):(t+=a.template,c&&(t=t.replace(/%t/,p)),l&&(t=t.replace(/%l/,f)),u&&(t=t.replace(/%n/,m))),h.length&&"string"==typeof h[0]?h[0]=t+" "+h[0]:h.unshift(t)}s.apply(void 0,h)}}),(n=n||{}).template&&(n.format=void 0),r[i]=function(e){for(var t,n=1,s=arguments.length;n<s;n++)for(t in arguments[n])Object.prototype.hasOwnProperty.call(arguments[n],t)&&(e[t]=arguments[n][t]);return e}({},a,n),e.setLevel(e.getLevel()),t||e.warn("It is necessary to call the function reg() of loglevel-plugin-prefix before calling apply. From the next release, it will throw an error. See more: https://github.com/kutuluk/loglevel-plugin-prefix/blob/master/README.md"),e}};return e&&(n=e.prefix,o.noConflict=function(){return e.prefix===o&&(e.prefix=n),o}),o},"function"==typeof define&&define.amd?define(s):"object"==typeof t&&t.exports?t.exports=s():n.prefix=s(n)}}),C=class e{constructor(t){this.element=t,this.next=e.Undefined,this.prev=e.Undefined}};C.Undefined=new C(void 0);var A=C,I=e("LinkedList",class{constructor(){this._first=A.Undefined,this._last=A.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===A.Undefined}clear(){let e=this._first;for(;e!==A.Undefined;){const{next:t}=e;e.prev=A.Undefined,e.next=A.Undefined,e=t}this._first=A.Undefined,this._last=A.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const n=new A(e);if(this._first===A.Undefined)this._first=n,this._last=n;else if(t){const e=this._last;this._last=n,n.prev=e,e.next=n}else{const e=this._first;this._first=n,n.next=e,e.prev=n}this._size+=1;let s=!1;return()=>{s||(s=!0,this._remove(n))}}shift(){if(this._first===A.Undefined)return;const e=this._first.element;return this._remove(this._first),e}pop(){if(this._last===A.Undefined)return;const e=this._last.element;return this._remove(this._last),e}_remove(e){if(e.prev!==A.Undefined&&e.next!==A.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===A.Undefined&&e.next===A.Undefined?(this._first=A.Undefined,this._last=A.Undefined):e.next===A.Undefined?(this._last=this._last.prev,this._last.next=A.Undefined):e.prev===A.Undefined&&(this._first=this._first.next,this._first.prev=A.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==A.Undefined;)yield e.element,e=e.next}});function U(e){const t=this;let n,s=!1;return function(){return s||(s=!0,n=e.apply(t,arguments)),n}}function _(e){return{dispose:U((()=>{e()}))}}var N=e("CommandsRegistry",class{constructor(){this.commands=new Map}registerCommand(e,t,n){if(!e)throw new Error("invalid command");if("string"==typeof e){if(!t)throw new Error("invalid command");return this.registerCommand({id:e,handler:t,opts:n})}const{id:s}=e;let r=this.commands.get(s);r||(r=new I,this.commands.set(s,r));const o=r.unshift(e);return _((()=>{o();const e=this.commands.get(s);(null==e?void 0:e.isEmpty())&&this.commands.delete(s)}))}hasCommand(e){return this.commands.has(e)}getCommand(e){const t=this.commands.get(e);if(t&&!t.isEmpty())return t[Symbol.iterator]().next().value}getCommands(){const e=new Map,t=this.commands.keys();for(const n of t){const t=this.getCommand(n);t&&e.set(n,t)}return e}getCommandOpt(e){const t=this.getCommand(e);return null==t?void 0:t.opts}}),L=e("CommandController",class{constructor(){this.commandRegister=new N}register(e,t,n){return this.commandRegister.registerCommand(e,t,n)}async execute(e,...t){const n=this.commandRegister.getCommand(e);if(n)return n.handler(...t);throw new Error("未注册指令: ".concat(e,",请先注册指令"))}hasCommand(e,t){const n=!!this.commandRegister.hasCommand(e);if(!0===t&&!0===n)throw new Error("未注册指令: ".concat(e,",请先注册指令"));return n}getCommandOpts(e){return this.commandRegister.getCommandOpt(e)}}),M=(e("commands",new L),e("CoreConst",class{}));M.DEFAULT_MODEL_SERVICE_TAG="default",M.TOKEN="ibzuaa-token",M.TOKEN_EXPIRES="ibzuaa-token-expires";var S=e("NOOP",(()=>{})),k=(e("HttpStatusMessageConst",{200:"服务器成功返回请求的数据。",201:"新建或修改数据成功。",202:"一个请求已经进入后台排队(异步任务)。",204:"删除数据成功。",400:"发出的请求有错误,服务器没有进行新建或修改数据的操作。",401:"用户没有权限(令牌、用户名、密码错误)。",403:"用户得到授权,但是访问是被禁止的。",404:"发出的请求针对的是不存在的记录,服务器没有进行操作。",406:"请求的格式不可得。",410:"请求的资源被永久删除,且不会再得到的。",422:"当创建一个对象时,发生一个验证错误。",500:"服务器发生错误,请检查服务器。",502:"网关错误。",503:"服务不可用,服务器暂时过载或维护。",504:"网关超时。"}),e("LoginMode",(e=>(e.DEFAULT="DEFAULT",e.CUSTOM="CUSTOM",e.CAS="CAS",e))(k||{}))),P=e("MenuPermissionMode",(e=>(e.MIXIN="MIXIN",e.RESOURCE="RESOURCE",e.RT="RT",e))(P||{})),j=(e("IBizContext",class e{constructor(e={},t){Object.defineProperty(this,"_associationContext",{enumerable:!1,value:[]}),t&&this.initWithParent(t),Object.assign(this,e)}initWithParent(e){const t=this;Object.defineProperty(this,"_parent",{enumerable:!1,writable:!0,value:e}),Object.defineProperty(this,"_context",{enumerable:!1,writable:!0,value:{}});const n={};Object.keys(e).forEach((e=>{Object.prototype.hasOwnProperty.call(this,e)||(n[e]={enumerable:!0,set(n){t._context[e]=null==n?null:n},get:()=>void 0!==t._context[e]?t._context[e]:t._parent[e]})})),Object.defineProperties(this,n)}getOwnContext(){const e={};return Object.keys(this).forEach((t=>{this._parent&&Object.prototype.hasOwnProperty.call(this._parent,t)&&!Object.prototype.hasOwnProperty.call(this._context,t)||(e[t]=this[t])})),e}destroy(){this._parent=void 0,this._context={},this._associationContext.forEach((e=>{e.destroy()}))}clone(){const n=new e(t(this.getOwnContext()),this._parent);return this._associationContext.push(n),n}reset(e={},t){this._associationContext.forEach((e=>{e.destroy()})),this._parent&&(this._parent={},this._context={}),Object.keys(this).forEach((e=>{try{delete this[e]}catch(e){}})),t&&this.initWithParent(t),Object.assign(this,e)}static create(t,n){return new e(t,n)}}),e("Environment",{dev:!1,hub:!0,isEnableMultiLan:!1,logLevel:"ERROR",baseUrl:"/api",appId:"",pluginBaseUrl:"./plugins",isLocalModel:!1,remoteModelUrl:"/remotemodel",assetsUrl:"./assets",dcSystem:"",downloadFileUrl:"/ibizutil/download",uploadFileUrl:"/ibizutil/upload",casLoginUrl:"",loginMode:"DEFAULT",menuPermissionMode:"MIXIN",enablePermission:!0,routePlaceholder:"-",enableWfAllHistory:!1,isMob:!1,isSaaSMode:!0,AppTitle:"应用",favicon:"./favicon.ico"})),D=e("HttpError",class extends Error{constructor(e){super("HttpError"),this.name="HttpError";const t=e.response;this.response=e.response,t?(t.data?this.message=t.data.message:this.message=t.statusText,this.message||(this.message="网络异常,请稍后重试!"),this.status=t.status):(this.message=e.message,this.status=500)}}),F=(e("ModelError",class extends Error{constructor(e,t){super("「".concat(e.id,"」模型").concat(t?": ".concat(t):"")),this.model=e,this.name="未支持的模型"}}),e("RuntimeError",class extends Error{constructor(e){super(e),this.message=e,this.name="Runtime Error"}}));e("RuntimeModelError",class extends Error{constructor(e,t){super("「".concat(e.id,"」模型").concat(t?": ".concat(t):"")),this.model=e,this.name="模型配置缺失"}}),e("NoticeError",class extends Error{constructor(e,t){super(e),this.message=e,this.duration=t,this.name="notice Error"}});function z(){return l(M.TOKEN)}var B=e("Interceptor",class{async onBeforeRequest(e){return e}onRequestError(e){return Promise.reject(e)}async onResponseSuccess(e){return e}onResponseError(e){return Promise.reject(e)}use(e){this.requestTag=e.interceptors.request.use(this.onBeforeRequest,this.onRequestError),this.responseTag=e.interceptors.response.use(this.onResponseSuccess,this.onResponseError)}eject(e){this.requestTag&&e.interceptors.request.eject(this.requestTag),this.responseTag&&e.interceptors.response.eject(this.responseTag)}}),q=e("CoreInterceptor",class extends B{async onBeforeRequest(e){e=await super.onBeforeRequest(e);const{headers:t}=e;t.set("Authorization","Bearer ".concat(z()));let n=ibiz.env.dcSystem;const{orgData:s}=ibiz;return s&&(s.systemid&&(n=s.systemid),s.orgid&&t.set("srforgid",s.orgid)),t.set("srfsystemid",n),e}}),V=class{constructor(e){this.parent=e,this.evt=new d(1e3)}next(e){this.evt.emit("all",e),this.parent&&this.nextParent(e)}nextParent(e){this.parent&&(this.parent.evt.emit("all",e),this.parent.nextParent(e))}on(e){this.evt.on("all",e)}off(e){this.evt.off("all",e)}},H=class extends V{},W=class extends V{sendCommand(e,t){const n={messageid:h(),messagename:"command",type:"COMMAND",subtype:t,data:e};this.next(n)}},J=class extends W{send(e){this.sendCommand(e,"OBJECTCREATED")}},Y=class extends W{send(e){this.sendCommand(e,"OBJECTUPDATED")}},$=class extends W{send(e){this.sendCommand(e,"OBJECTREMOVED")}},X=class extends W{},G=class extends V{constructor(){super(...arguments),this.change=new X,this.create=new J(this),this.update=new Y(this),this.remove=new $(this)}next(e){switch(e.subtype){case"OBJECTCREATED":this.create.next(e),this.change.next(e);break;case"OBJECTUPDATED":this.update.next(e),this.change.next(e);break;case"OBJECTREMOVED":this.remove.next(e),this.change.next(e);break;default:super.next(e)}}nextParent(e){switch(e.subtype){case"OBJECTCREATED":case"OBJECTUPDATED":case"OBJECTREMOVED":this.change.next(e)}super.nextParent(e)}send(e,t){const n={messageid:h(),messagename:"command",type:"COMMAND",subtype:t,data:e};this.next(n)}},K=class extends V{send(e){const t={messageid:h(),messagename:"console",type:"CONSOLE",data:e};this.next(t)}},Z=e("MessageCenter",class{constructor(){this.all=new H,this.command=new G(this.all),this.console=new K(this.all)}next(e){"COMMAND"===e.type?this.command.next(e):"CONSOLE"===e.type?this.console.next(e):this.all.next(e)}on(e){this.all.on(e)}off(e){this.all.off(e)}});function Q(e,t,n,s,r){let o="".concat(e,"-").concat(t);return n&&(o+="-".concat(n)),s&&(o+="__".concat(s)),r&&(o+="--".concat(r)),o}e("Namespace",class{constructor(e,t){this.block=e,this.namespace=t||"ibiz"}b(e=""){return Q(this.namespace,this.block,e,"","")}e(e){return e?Q(this.namespace,this.block,"",e,""):""}m(e){return e?Q(this.namespace,this.block,"","",e):""}be(e,t){return e&&t?Q(this.namespace,this.block,e,t,""):""}em(e,t){return e&&t?Q(this.namespace,this.block,"",e,t):""}bm(e,t){return e&&t?Q(this.namespace,this.block,e,"",t):""}bem(e,t,n){return e&&t&&n?Q(this.namespace,this.block,e,t,n):""}is(e,t){return e&&t?"".concat("is-").concat(e):""}cssVar(e){const t={};for(const n in e)e[n]&&(t[this.cssVarName(n)]=e[n]);return t}cssVarBlock(e){const t={};for(const n in e)e[n]&&(t[this.cssVarBlockName(n)]=e[n]);return t}cssVarName(e){return"--".concat(this.namespace,"-").concat(e)}cssVarBlockName(e){return"--".concat(this.namespace,"-").concat(this.block,"-").concat(e)}}),e("HttpResponse",class{constructor(e,t,n){this.local=!0,this.ok=!1,this.headers={},this.config={headers:new p},this.data=e,this.status=t||200,this.statusText=n||"",this.status>=200&&this.status<300&&(this.ok=!0)}});function ee(e){let t,n,s,r=!1;return function(o){void 0===t?(t=o,n=0,s=-1):t=function(e,t){const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}(t,o);const i=t.length;let a=0;for(;n<i;){r&&(10===t[n]&&(a=++n),r=!1);let o=-1;for(;n<i&&-1===o;++n)switch(t[n]){case 58:-1===s&&(s=n-a);break;case 13:r=!0;case 10:o=n}if(-1===o)break;e(t.subarray(a,o),s),a=n,s=-1}a===i?t=void 0:0!==a&&(t=t.subarray(a),n-=a)}}var te="text/event-stream",ne="last-event-id";function se(e,t){var{signal:n,headers:s,onopen:r,onmessage:o,onclose:i,onerror:a,openWhenHidden:c,fetch:l}=t,u=function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(n[s[r]]=e[s[r]])}return n}(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise(((t,h)=>{const d=Object.assign({},s);let p;function f(){p.abort(),document.hidden||b()}d.accept||(d.accept=te),c||document.addEventListener("visibilitychange",f);let m=1e3,g=0;function w(){document.removeEventListener("visibilitychange",f),window.clearTimeout(g),p.abort()}null==n||n.addEventListener("abort",(()=>{w(),t()}));const y=null!=l?l:window.fetch,v=null!=r?r:re;async function b(){var n;p=new AbortController;try{const n=await y(e,Object.assign(Object.assign({},u),{headers:d,signal:p.signal}));await v(n),await async function(e,t){const n=e.getReader();let s;for(;!(s=await n.read()).done;)t(s.value)}(n.body,ee(function(e,t,n){let s={data:"",event:"",id:"",retry:void 0};const r=new TextDecoder;return function(o,i){if(0===o.length)null==n||n(s),s={data:"",event:"",id:"",retry:void 0};else if(i>0){const n=r.decode(o.subarray(0,i)),a=i+(32===o[i+1]?2:1),c=r.decode(o.subarray(a));switch(n){case"data":s.data=s.data?s.data+"\n"+c:c;break;case"event":s.event=c;break;case"id":e(s.id=c);break;case"retry":const n=parseInt(c,10);isNaN(n)||t(s.retry=n)}}}}((e=>{e?d[ne]=e:delete d[ne]}),(e=>{m=e}),o))),null==i||i(),w(),t()}catch(e){if(!p.signal.aborted)try{const t=null!==(n=null==a?void 0:a(e))&&void 0!==n?n:m;window.clearTimeout(g),g=window.setTimeout(b,t)}catch(e){w(),h(e)}}}b()}))}function re(e){const t=e.headers.get("content-type");if(!(null==t?void 0:t.startsWith(te)))throw new Error("Expected content-type to be ".concat(te,", Actual: ").concat(t))}var oe=e("Net",class{constructor(e){this.urlReg=/^http[s]?:\/\/[^\s]*/,this.waitRequest=new Map,this.interceptors=new Map,this.instance=f.create(e),this.addInterceptor("Default",new q)}get baseUrl(){return this.instance.defaults.baseURL||"".concat(ibiz.env.baseUrl,"/").concat(ibiz.env.appId)}addInterceptor(e,t){t.use(this.instance),this.interceptors.set(e,t)}removeInterceptor(e){const t=this.interceptors.get(e);t&&(t.eject(this.instance),this.interceptors.delete(e))}get presetConfig(){return{baseURL:this.baseUrl,headers:{"Content-Type":"application/json;charset=UTF-8",Accept:"application/json"}}}mergeConfig(...e){const t=this.presetConfig;if(0===e.length)return t;const{url:n}=e[0];return n&&this.urlReg.test(n)&&delete t.baseURL,i(t,...e)}async post(e,t,n={},s={}){e=this.handleAppPresetParam(e,n);try{const n=await this.request(e,{method:"post",data:t,headers:s});return this.doResponseResult(n)}catch(e){throw new D(e)}}async get(e,t={},n={},s={}){e=this.attachUrlParam(e,t);try{const t=await this.request(e,i({method:"get",headers:n},s));return this.doResponseResult(t)}catch(e){throw new D(e)}}async delete(e,t,n={}){e=this.handleAppPresetParam(e,t);try{const t=await this.request(e,{method:"delete",headers:n});return this.doResponseResult(t)}catch(e){throw new D(e)}}async put(e,t,n={},s={}){e=this.handleAppPresetParam(e,n);try{const n=await this.request(e,{method:"put",data:t,headers:s});return this.doResponseResult(n)}catch(e){throw new D(e)}}async getModel(e,t={}){try{const n=await this.instance.get(e,{headers:t});return this.doResponseResult(n)}catch(e){throw new D(e)}}async request(e,t={}){const n=this.mergeConfig({url:e},t),s=JSON.stringify(n);try{let e=null;this.waitRequest.has(s)?e=this.waitRequest.get(s):(e=this.instance.request(n),this.waitRequest.set(s,e));const t=await e;return this.waitRequest.has(s)&&this.waitRequest.delete(s),this.doResponseResult(t)}catch(e){throw this.waitRequest.has(s)&&this.waitRequest.delete(s),new D(e)}}axios(e){return f(e)}async sse(e,t,n={}){e=this.attachUrlParam(this.baseUrl+e,t),n.headers||(n.headers={});const s=n.headers;{s.Authorization="Bearer ".concat(z());let e=ibiz.env.dcSystem;const{orgData:t}=ibiz;t&&(t.systemid&&(e=t.systemid),t.orgid&&(s.srforgid=t.orgid)),s.srfsystemid=e}await se(e,r({method:"POST"},n))}doResponseResult(e){const t=e;return t.status>=200&&t.status<=299&&(t.ok=!0),t}handleAppPresetParam(e,t){if(t){return Object.keys(t).forEach((e=>{e.startsWith("srf")&&u(t[e])&&t[e]})),this.attachUrlParam(e,t)}return e}attachUrlParam(e,t){const n=m(t);return u(n)&&(e=e.endsWith("?")||-1!==e.indexOf("?")&&e.endsWith("&")?"".concat(e).concat(n):-1===e.indexOf("?")||e.endsWith("&")?"".concat(e,"?").concat(n):"".concat(e,"&").concat(n)),e}}),ie=e("StringUtil",class{static fill(e,t,n){if(u(e)){if(u(t)){const n=e.match(this.contextReg);null==n||n.forEach((n=>{const s=n.slice(10,n.length-1);e=e.replace("${context.".concat(s,"}"),t[s]||"")}))}if(u(n)){const t=e.match(this.dataReg);null==t||t.forEach((t=>{const s=t.slice(7,t.length-1);e=e.replace("${data.".concat(s,"}"),n[s]||"")}))}}return e}});ie.contextReg=/\$\{context.[a-zA-Z_$][a-zA-Z0-9_$]{1,}\}/g,ie.dataReg=/\$\{data.[a-zA-Z_$][a-zA-Z0-9_$]{1,}\}/g;e("UrlHelper",class{static get routeBase(){const e=window.location.href.lastIndexOf("#/");return window.location.href.slice(0,e+1)}static get appBase(){const{origin:e,pathname:t}=window.location;return"".concat(e).concat(t).replace(/\/$/,"")}static get routePath(){return window.location.hash.replace("#","")}static get fullPath(){return window.location.href}});function ae(e){const t=e.composedPath&&e.composedPath()||e.path;if(null!=t)return t;return[e.target].concat(function e(t,n=[]){const s=t.parentNode;return s?e(s,n.concat([s])):n}(e.target))}function ce(e,t,n,s={}){e.addEventListener(t,n,s);let r=()=>{e.removeEventListener(t,n,s),r=S};return()=>{r()}}function le(e,t){return t&&(e.target===t||ae(e).includes(t))}var ue="undefined"!=typeof window?window:void 0;var he=Math.round;function de(e){const t=e.length,n=[];if("rgb"===e.slice(0,3).toLowerCase()){const t=e.match(/([\d|.%]{1,3})/g);n[0]=parseInt(t[0],10),n[1]=parseInt(t[1],10),n[2]=parseInt(t[2],10),n[3]=t[3]?-1!==t[3].indexOf("%")?parseInt(t[3],10)/100:parseFloat(t[3]):1}else{let s;s=t<6?parseInt(String(e[1])+e[1]+e[2]+e[2]+e[3]+e[3]+(t>4?String(e[4])+e[4]:""),16):parseInt(e.slice(1),16),n[0]=s>>16&255,n[1]=s>>8&255,n[2]=255&s,n[3]=9===t||5===t?he((s>>24&255)/255*1e4)/1e4:1}return n}function pe(e){let t="";switch(e.split(".").pop()){case".wps":t="application/kswps";break;case".doc":t="application/msword";break;case".docx":t="application/vnd.openxmlformats-officedocument.wordprocessingml.document";break;case".txt":t="text/plain";break;case".zip":t="application/zip";break;case".png":t="image/png";break;case".gif":t="image/gif";break;case".jpeg":case".jpg":t="image/jpeg";break;case".rtf":t="application/rtf";break;case".avi":t="video/x-msvideo";break;case".gz":t="application/x-gzip";break;case".tar":t="application/x-tar";break;case".xlsx":t="application/vnd.ms-excel";break;default:t=""}return t}function fe(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n]);return t}function me(e){const t=i({multiple:!0,accept:""},e),n=document.createElement("input");n.setAttribute("type","file"),n.setAttribute("multiple","".concat(t.multiple)),n.setAttribute("accept",t.accept),n.onchange=e=>{const n=e.target,s=n.files?fe(n.files):[];0!==s.length&&(t.onSelected(s),n.value="")},document.body.appendChild(n),n.click(),document.body.removeChild(n)}e("CountLatch",class{constructor(){this.promise=null,this.resolve=null,this.count=0}startPromise(){this.promise=new Promise((e=>{this.resolve=e}))}endPromise(){this.resolve&&(this.resolve(),this.resolve=null,this.promise=null)}lock(){this.count+=1,this.promise||this.startPromise()}unlock(){if(this.count<1)throw new F("lock和unlock次数不匹配!");this.count-=1,0===this.count&&this.endPromise()}async await(){this.promise&&await this.promise}});var ge={childrenFields:["children"]},we=new Error("中断操作");function ye(e,t,n){try{!function(e,t,n){const{childrenFields:s}=r(ge,n||{}),o=function(e,t){var n;for(const s of t)if(null==(n=e[s])?void 0:n.length)return e[s]}(e,s);if(null==o?void 0:o.length)for(const e of o){if(t(e))throw we;ye(e,t,n)}}(e,t,n)}catch(e){if(e!==we)throw e}}var ve={...ge,compareField:"name"};e("DataTypes",class{static isNumber(e){return["BIGINT","BINARY","DECIMAL","FLOAT","INT","MONEY","NUMERIC","REAL","SMALLINT","SMALLMONEY","TINYINT","VARBINARY"].includes(this.toString(e))}static isDate(e){return["DATETIME","SMALLDATETIME","DATE","TIME"].includes(this.toString(e))}static toString(e){return this.typeMap[e]}}).typeMap={0:"UNKNOWN",1:"BIGINT",2:"BINARY",3:"BIT",4:"CHAR",5:"DATETIME",6:"DECIMAL",7:"FLOAT",8:"IMAGE",9:"INT",10:"MONEY",11:"NCHAR",12:"NTEXT",13:"NVARCHAR",14:"NUMERIC",15:"REAL",16:"SMALLDATETIME",17:"SMALLINT",18:"SMALLMONEY",19:"SQL_VARIANT",20:"SYSNAME",21:"TEXT",22:"TIMESTAMP",23:"TINYINT",24:"VARBINARY",25:"VARCHAR",26:"UNIQUEIDENTIFIER",27:"DATE",28:"TIME",29:"BIGDECIMAL"};var be=R(O(),1),Ee=R(T(),1),xe=be.noConflict();Ee.reg(xe),Ee.apply(xe);var Re=e("IBizSys",class{constructor(){this.env=j,this.log=xe,this.net=new oe,this.commands=new L,this.mc=new Z}})}}}));
1
+ System.register(["ramda","lodash-es","qx-util","axios","qs"],(function(e){"use strict";var t,n,s,r,o,i,a,c,l,u,h,d,p,f,m;return{setters:[function(e){t=e.clone,n=e.isNotNil,s=e.isNil,r=e.mergeDeepRight},function(e){o=e.debounce,i=e.merge,a=e.uniqueId,e.round,e.cloneDeep,c=e.isFunction},function(e){l=e.getCookie,u=e.notNilEmpty,h=e.createUUID,d=e.QXEvent},function(e){p=e.AxiosHeaders,f=e.default},function(e){m=e.stringify}],execute:function(){e({awaitTimeout:async function(e,t,n){if(await new Promise((t=>{setTimeout((()=>{t(!0)}),e)})),t)return t(...n||[])},calcMimeByFileName:ge,colorBlend:function(e,t,n=.5,s="hex"){e=e.trim(),t=t.trim();const r=me(e),o=me(t),i=[fe((1-n)*r[0]+n*o[0]),fe((1-n)*r[1]+n*o[1]),fe((1-n)*r[2]+n*o[2]),(1-n)*r[3]+n*o[3]];if("hex"===s){const e=[i[0].toString(16),i[1].toString(16),i[2].toString(16),0===i[3]?"00":fe(255*i[3]).toString(16)];return"#".concat(e[0]).concat(e[1]).concat(e[2]).concat(e[3])}return"rgb(".concat(i[0]," ").concat(i[1]," ").concat(i[2]," / ").concat(i[3],")")},compareArr:function(e,t,n){const s=new Set([...e,...t]),r=[],o=[],i=[];if(n){const a=e.map((e=>e[n])),c=t.map((e=>e[n]));s.forEach((e=>{a.includes(e[n])?c.includes(e[n])?i.push(e):r.push(e):o.push(e)}))}else s.forEach((n=>{e.includes(n)?t.includes(n)?i.push(n):r.push(n):o.push(n)}));return{more:r,less:o,same:i}},debounce:function(e,t,n){let s;return function(...r){if(s&&clearTimeout(s),n){const n=!s;s=setTimeout((()=>{s=null}),t),n&&e.apply(this,r)}else s=setTimeout((()=>{e.apply(this,r)}),t)}},debounceAndAsyncMerge:function(e,t,n){let s,r=[];const i=o((async(...t)=>{s=void 0;try{const n=await e(...t);return r.forEach((e=>{e.resolve(n)})),r=[],n}catch(e){r.forEach((t=>{t.reject(e)})),r=[]}}),n);return async(...e)=>{let n=e;return s&&(n=t(s,n)),s=n,i(...n),new Promise(((e,t)=>{r.push({resolve:e,reject:t})}))}},debounceAndMerge:function(e,t,n){let s;const r=o(((...t)=>(s=void 0,e(...t))),n);return(...e)=>{let n=e;return s&&(n=t(s,n)),s=n,r(...n)}},downloadFileFromBlob:function(e,t){const n=ge(t),s=new Blob([e],{type:n}),r=URL.createObjectURL(s),o=document.createElement("a");o.href=r,o.download=t,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(r)},eventPath:ue,fetchEventSource:N,fileListToArr:we,findRecursiveChild:function(e,t,n){const{compareField:s,compareCallback:o}=r(xe,n||{}),i=o||(e=>e[s]===t);let a;return Ee(e,(e=>{if(i(e,t,s))return a=e,!0}),n),a},getToken:Y,install:function(){if(window.ibiz)throw new Error("ibiz 已经存在, 无需重复安装");window.ibiz=new Ce},isElementSame:function(e,t,n){if(e.length!==t.length)return!1;const s=n?[...e.map((e=>e[n])),...t.map((e=>e[n]))]:[...e,...t];return Array.from(new Set(s)).length===e.length},isEventInside:de,isImage:function(e){const t=e.split(".").pop();if(!t)return!1;return[".jpeg","jpg","gif","png","bmp","svg"].includes(t)},isOverlap:function(e,t){return Array.from(new Set([...e,...t])).length!==e.length+t.length},isSvg:function(e){return $.test(e)},listenJSEvent:he,mergeDefaultInLeft:function(e,t){Object.keys(t).forEach((r=>{n(t[r])&&s(e[r])&&(e[r]=t[r])}))},mergeInLeft:function(e,t){Object.keys(t).forEach((s=>{n(t[s])&&(e[s]=t[s])}))},onClickOutside:function(e,t,n={}){const{window:s=pe,ignore:r=[],capture:o=!0}=n;if(!e)throw new J("target元素不存在");if(!s)throw new J("找不到window");let i=!0;const a=t=>![e,...r].some((e=>de(t,e)));let c=!1;let l;const u=e=>{c||(s.clearTimeout(l),i&&a(e)&&t(e))},h=[he(s,"click",u,{passive:!0,capture:o}),he(s,"pointerdown",(e=>{c||(i=a(e))}),{passive:!0}),he(s,"pointerup",(e=>{if(!c&&0===e.button){const t=ue(e);e.composedPath=()=>t,l=s.setTimeout((()=>u(e)),50)}}),{passive:!0})].filter(Boolean);return{stop:()=>h.forEach((e=>e())),pause:()=>{c=!0},proceed:()=>{c=!1}}},recursiveIterate:Ee,selectFile:ve,setRemoteStyle:async function(e){try{const t=await ibiz.net.get(e),n=document.createElement("style");n.setAttribute("title","app-style-css"),n.innerText=t.data,document.head.appendChild(n)}catch(t){ibiz.log.debug("加载远程样式表失败",e)}},throttle:function(e,t){let n=null;return function(...s){n||(n=setTimeout((()=>{e.apply(this,s),n=null}),t))}},toDisposable:j,toNumberOrNil:function(e){if(s(e))return;const t=Number(e);if(Number.isNaN(t))return;return t},uploadFile:function(e){const t=i({multiple:!0,accept:"",separate:!0,beforeUpload:(e,t)=>!0,finish:e=>{},success:(e,t)=>{},error:(e,t)=>{},progress:e=>{}},e),n=async e=>{const n=e.map((e=>({status:"uploading",name:e.name,uid:a(),percentage:0})));if(!t.beforeUpload(e,n))return n.forEach((e=>{e.status="cancel"})),ibiz.log.debug("取消上传",n),n;try{const s=await(async(e,n)=>{if(t.request&&c(t.request))return t.request(e);const s=new FormData;throw e.forEach((e=>{s.append("file",e)})),new J("多应用模式等待重新实现请求")})(e);n.forEach((e=>{e.status="finished"})),t.success(n,s),n.forEach((e=>{e.response=s}))}catch(s){n.forEach((e=>{e.status="fail"})),t.error(n,s),n.forEach((e=>{e.error=s})),ibiz.log.error(s),ibiz.log.error("".concat(e.map((e=>e.name)).join(","),"上传失败"))}return n};ve({accept:t.accept,multiple:t.multiple,onSelected:e=>{(async e=>{const s=t.separate?e.map((e=>[e])):[e],r=await Promise.allSettled(s.map((async e=>n(e)))),o=[];r.forEach((e=>{"fulfilled"===e.status&&o.push(...e.value)})),t.finish(o)})(e)}})}});var g=Object.create,w=Object.defineProperty,v=Object.getOwnPropertyDescriptor,y=Object.getOwnPropertyNames,b=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty,x=(e,t)=>function(){return t||(0,e[y(e)[0]])((t={exports:{}}).exports,t),t.exports},R=(e,t,n)=>(n=null!=e?g(b(e)):{},((e,t,n,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of y(t))E.call(e,r)||r===n||w(e,r,{get:()=>t[r],enumerable:!(s=v(t,r))||s.enumerable});return e})(!t&&e&&e.__esModule?n:w(n,"default",{value:e,enumerable:!0}),e)),T=x({"../../node_modules/.pnpm/loglevel@1.8.1/node_modules/loglevel/lib/loglevel.js"(e,t){var n,s;n=e,s=function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),s=["trace","debug","info","warn","error"];function r(e,t){var n=e[t];if("function"==typeof n.bind)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch(t){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function o(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function i(t,n){for(var r=0;r<s.length;r++){var o=s[r];this[o]=r<t?e:this.methodFactory(o,t,n)}this.log=this.debug}function a(e,n,s){return function(){typeof console!==t&&(i.call(this,n,s),this[e].apply(this,arguments))}}function c(s,i,c){return function(s){return"debug"===s&&(s="log"),typeof console!==t&&("trace"===s&&n?o:void 0!==console[s]?r(console,s):void 0!==console.log?r(console,"log"):e)}(s)||a.apply(this,arguments)}function l(e,n,r){var o,a=this;n=null==n?"WARN":n;var l="loglevel";function u(){var e;if(typeof window!==t&&l){try{e=window.localStorage[l]}catch(e){}if(typeof e===t)try{var n=window.document.cookie,s=n.indexOf(encodeURIComponent(l)+"=");-1!==s&&(e=/^([^;]+)/.exec(n.slice(s))[1])}catch(e){}return void 0===a.levels[e]&&(e=void 0),e}}"string"==typeof e?l+=":"+e:"symbol"==typeof e&&(l=void 0),a.name=e,a.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},a.methodFactory=r||c,a.getLevel=function(){return o},a.setLevel=function(n,r){if("string"==typeof n&&void 0!==a.levels[n.toUpperCase()]&&(n=a.levels[n.toUpperCase()]),!("number"==typeof n&&n>=0&&n<=a.levels.SILENT))throw"log.setLevel() called with invalid level: "+n;if(o=n,!1!==r&&function(e){var n=(s[e]||"silent").toUpperCase();if(typeof window!==t&&l){try{return void(window.localStorage[l]=n)}catch(e){}try{window.document.cookie=encodeURIComponent(l)+"="+n+";"}catch(e){}}}(n),i.call(a,n,e),typeof console===t&&n<a.levels.SILENT)return"No console available for logging"},a.setDefaultLevel=function(e){n=e,u()||a.setLevel(e,!1)},a.resetLevel=function(){a.setLevel(n,!1),function(){if(typeof window!==t&&l){try{return void window.localStorage.removeItem(l)}catch(e){}try{window.document.cookie=encodeURIComponent(l)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}()},a.enableAll=function(e){a.setLevel(a.levels.TRACE,e)},a.disableAll=function(e){a.setLevel(a.levels.SILENT,e)};var h=u();null==h&&(h=n),a.setLevel(h,!1)}var u=new l,h={};u.getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=h[e];return t||(t=h[e]=new l(e,u.getLevel(),u.methodFactory)),t};var d=typeof window!==t?window.log:void 0;return u.noConflict=function(){return typeof window!==t&&window.log===u&&(window.log=d),u},u.getLoggers=function(){return h},u.default=u,u},"function"==typeof define&&define.amd?define(s):"object"==typeof t&&t.exports?t.exports=s():n.log=s()}}),O=x({"../../node_modules/.pnpm/loglevel-plugin-prefix@0.8.4/node_modules/loglevel-plugin-prefix/lib/loglevel-plugin-prefix.js"(e,t){var n,s;n=e,s=function(e){var t,n,s={template:"[%t] %l:",levelFormatter:function(e){return e.toUpperCase()},nameFormatter:function(e){return e||"root"},timestampFormatter:function(e){return e.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/,"$1")},format:void 0},r={},o={reg:function(e){if(!e||!e.getLogger)throw new TypeError("Argument is not a root logger");t=e},apply:function(e,n){if(!e||!e.setLevel)throw new TypeError("Argument is not a logger");var o=e.methodFactory,i=e.name||"",a=r[i]||r[""]||s;return r[i]||(e.methodFactory=function(e,t,n){var s=o(e,t,n),a=r[n]||r[""],c=-1!==a.template.indexOf("%t"),l=-1!==a.template.indexOf("%l"),u=-1!==a.template.indexOf("%n");return function(){for(var t="",o=arguments.length,h=Array(o),d=0;d<o;d++)h[d]=arguments[d];if(i||!r[n]){var p=a.timestampFormatter(new Date),f=a.levelFormatter(e),m=a.nameFormatter(n);a.format?t+=a.format(f,m,p):(t+=a.template,c&&(t=t.replace(/%t/,p)),l&&(t=t.replace(/%l/,f)),u&&(t=t.replace(/%n/,m))),h.length&&"string"==typeof h[0]?h[0]=t+" "+h[0]:h.unshift(t)}s.apply(void 0,h)}}),(n=n||{}).template&&(n.format=void 0),r[i]=function(e){for(var t,n=1,s=arguments.length;n<s;n++)for(t in arguments[n])Object.prototype.hasOwnProperty.call(arguments[n],t)&&(e[t]=arguments[n][t]);return e}({},a,n),e.setLevel(e.getLevel()),t||e.warn("It is necessary to call the function reg() of loglevel-plugin-prefix before calling apply. From the next release, it will throw an error. See more: https://github.com/kutuluk/loglevel-plugin-prefix/blob/master/README.md"),e}};return e&&(n=e.prefix,o.noConflict=function(){return e.prefix===o&&(e.prefix=n),o}),o},"function"==typeof define&&define.amd?define(s):"object"==typeof t&&t.exports?t.exports=s():n.prefix=s(n)}});function C(e){let t,n,s,r=!1;return function(o){void 0===t?(t=o,n=0,s=-1):t=function(e,t){const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}(t,o);const i=t.length;let a=0;for(;n<i;){r&&(10===t[n]&&(a=++n),r=!1);let o=-1;for(;n<i&&-1===o;++n)switch(t[n]){case 58:-1===s&&(s=n-a);break;case 13:r=!0;case 10:o=n}if(-1===o)break;e(t.subarray(a,o),s),a=n,s=-1}a===i?t=void 0:0!==a&&(t=t.subarray(a),n-=a)}}var A=function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(n[s[r]]=e[s[r]])}return n},I=e("EventStreamContentType","text/event-stream"),U=1e3,_="last-event-id";function N(e,t){var{signal:n,headers:s,onopen:r,onmessage:o,onclose:i,onerror:a,openWhenHidden:c,fetch:l}=t,u=A(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise(((t,h)=>{const d=Object.assign({},s);let p;function f(){p.abort(),document.hidden||b()}d.accept||(d.accept=I),c||document.addEventListener("visibilitychange",f);let m=U,g=0;function w(){document.removeEventListener("visibilitychange",f),window.clearTimeout(g),p.abort()}null==n||n.addEventListener("abort",(()=>{w(),t()}));const v=null!=l?l:window.fetch,y=null!=r?r:L;async function b(){var n;p=new AbortController;try{const n=await v(e,Object.assign(Object.assign({},u),{headers:d,signal:p.signal}));await y(n),await async function(e,t){const n=e.getReader();let s;for(;!(s=await n.read()).done;)t(s.value)}(n.body,C(function(e,t,n){let s={data:"",event:"",id:"",retry:void 0};const r=new TextDecoder;return function(o,i){if(0===o.length)null==n||n(s),s={data:"",event:"",id:"",retry:void 0};else if(i>0){const n=r.decode(o.subarray(0,i)),a=i+(32===o[i+1]?2:1),c=r.decode(o.subarray(a));switch(n){case"data":s.data=s.data?s.data+"\n"+c:c;break;case"event":s.event=c;break;case"id":e(s.id=c);break;case"retry":const n=parseInt(c,10);isNaN(n)||t(s.retry=n)}}}}((e=>{e?d[_]=e:delete d[_]}),(e=>{m=e}),o))),null==i||i(),w(),t()}catch(e){if(!p.signal.aborted)try{const t=null!==(n=null==a?void 0:a(e))&&void 0!==n?n:m;window.clearTimeout(g),g=window.setTimeout(b,t)}catch(e){w(),h(e)}}}b()}))}function L(e){const t=e.headers.get("content-type");if(!(null==t?void 0:t.startsWith(I)))throw new Error("Expected content-type to be ".concat(I,", Actual: ").concat(t))}var S=class e{constructor(t){this.element=t,this.next=e.Undefined,this.prev=e.Undefined}};S.Undefined=new S(void 0);var M=S,k=e("LinkedList",class{constructor(){this._first=M.Undefined,this._last=M.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===M.Undefined}clear(){let e=this._first;for(;e!==M.Undefined;){const{next:t}=e;e.prev=M.Undefined,e.next=M.Undefined,e=t}this._first=M.Undefined,this._last=M.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const n=new M(e);if(this._first===M.Undefined)this._first=n,this._last=n;else if(t){const e=this._last;this._last=n,n.prev=e,e.next=n}else{const e=this._first;this._first=n,n.next=e,e.prev=n}this._size+=1;let s=!1;return()=>{s||(s=!0,this._remove(n))}}shift(){if(this._first===M.Undefined)return;const e=this._first.element;return this._remove(this._first),e}pop(){if(this._last===M.Undefined)return;const e=this._last.element;return this._remove(this._last),e}_remove(e){if(e.prev!==M.Undefined&&e.next!==M.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===M.Undefined&&e.next===M.Undefined?(this._first=M.Undefined,this._last=M.Undefined):e.next===M.Undefined?(this._last=this._last.prev,this._last.next=M.Undefined):e.prev===M.Undefined&&(this._first=this._first.next,this._first.prev=M.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==M.Undefined;)yield e.element,e=e.next}});function P(e){const t=this;let n,s=!1;return function(){return s||(s=!0,n=e.apply(t,arguments)),n}}function j(e){return{dispose:P((()=>{e()}))}}var D=e("CommandsRegistry",class{constructor(){this.commands=new Map}registerCommand(e,t,n){if(!e)throw new Error("invalid command");if("string"==typeof e){if(!t)throw new Error("invalid command");return this.registerCommand({id:e,handler:t,opts:n})}const{id:s}=e;let r=this.commands.get(s);r||(r=new k,this.commands.set(s,r));const o=r.unshift(e);return j((()=>{o();const e=this.commands.get(s);(null==e?void 0:e.isEmpty())&&this.commands.delete(s)}))}hasCommand(e){return this.commands.has(e)}getCommand(e){const t=this.commands.get(e);if(t&&!t.isEmpty())return t[Symbol.iterator]().next().value}getCommands(){const e=new Map,t=this.commands.keys();for(const n of t){const t=this.getCommand(n);t&&e.set(n,t)}return e}getCommandOpt(e){const t=this.getCommand(e);return null==t?void 0:t.opts}}),F=e("CommandController",class{constructor(){this.commandRegister=new D}register(e,t,n){return this.commandRegister.registerCommand(e,t,n)}async execute(e,...t){const n=this.commandRegister.getCommand(e);if(n)return n.handler(...t);throw new Error("未注册指令: ".concat(e,",请先注册指令"))}hasCommand(e,t){const n=!!this.commandRegister.hasCommand(e);if(!0===t&&!0===n)throw new Error("未注册指令: ".concat(e,",请先注册指令"));return n}getCommandOpts(e){return this.commandRegister.getCommandOpt(e)}}),z=(e("commands",new F),e("CoreConst",class{}));z.DEFAULT_MODEL_SERVICE_TAG="default",z.TOKEN="ibzuaa-token",z.TOKEN_EXPIRES="ibzuaa-token-expires";var B=e("NOOP",(()=>{})),q=(e("HttpStatusMessageConst",{200:"服务器成功返回请求的数据。",201:"新建或修改数据成功。",202:"一个请求已经进入后台排队(异步任务)。",204:"删除数据成功。",400:"发出的请求有错误,服务器没有进行新建或修改数据的操作。",401:"用户没有权限(令牌、用户名、密码错误)。",403:"用户得到授权,但是访问是被禁止的。",404:"发出的请求针对的是不存在的记录,服务器没有进行操作。",406:"请求的格式不可得。",410:"请求的资源被永久删除,且不会再得到的。",422:"当创建一个对象时,发生一个验证错误。",500:"服务器发生错误,请检查服务器。",502:"网关错误。",503:"服务不可用,服务器暂时过载或维护。",504:"网关超时。"}),e("LoginMode",(e=>(e.DEFAULT="DEFAULT",e.CUSTOM="CUSTOM",e.CAS="CAS",e))(q||{}))),H=e("MenuPermissionMode",(e=>(e.MIXIN="MIXIN",e.RESOURCE="RESOURCE",e.RT="RT",e))(H||{})),V=(e("IBizContext",class e{constructor(e={},t){Object.defineProperty(this,"_associationContext",{enumerable:!1,value:[]}),t&&this.initWithParent(t),Object.assign(this,e)}initWithParent(e){const t=this;Object.defineProperty(this,"_parent",{enumerable:!1,writable:!0,value:e}),Object.defineProperty(this,"_context",{enumerable:!1,writable:!0,value:{}});const n={};Object.keys(e).forEach((e=>{Object.prototype.hasOwnProperty.call(this,e)||(n[e]={enumerable:!0,set(n){t._context[e]=null==n?null:n},get:()=>void 0!==t._context[e]?t._context[e]:t._parent[e]})})),Object.defineProperties(this,n)}getOwnContext(){const e={};return Object.keys(this).forEach((t=>{this._parent&&Object.prototype.hasOwnProperty.call(this._parent,t)&&!Object.prototype.hasOwnProperty.call(this._context,t)||(e[t]=this[t])})),e}destroy(){this._parent=void 0,this._context={},this._associationContext.forEach((e=>{e.destroy()}))}clone(){const n=new e(t(this.getOwnContext()),this._parent);return this._associationContext.push(n),n}reset(e={},t){this._associationContext.forEach((e=>{e.destroy()})),this._parent&&(this._parent={},this._context={}),Object.keys(this).forEach((e=>{try{delete this[e]}catch(e){}})),t&&this.initWithParent(t),Object.assign(this,e)}static create(t,n){return new e(t,n)}}),e("Environment",{dev:!1,hub:!0,isEnableMultiLan:!1,logLevel:"ERROR",baseUrl:"/api",appId:"",pluginBaseUrl:"./plugins",isLocalModel:!1,remoteModelUrl:"/remotemodel",assetsUrl:"./assets",dcSystem:"",downloadFileUrl:"/ibizutil/download",uploadFileUrl:"/ibizutil/upload",casLoginUrl:"",loginMode:"DEFAULT",menuPermissionMode:"MIXIN",enablePermission:!0,routePlaceholder:"-",enableWfAllHistory:!1,isMob:!1,isSaaSMode:!0,AppTitle:"应用",favicon:"./favicon.ico"})),W=e("HttpError",class extends Error{constructor(e){super("HttpError"),this.name="HttpError";const t=e.response;this.response=e.response,t?(t.data?this.message=t.data.message:this.message=t.statusText,this.message||(this.message="网络异常,请稍后重试!"),this.status=t.status):(this.message=e.message,this.status=500)}}),J=(e("ModelError",class extends Error{constructor(e,t){super("「".concat(e.id,"」模型").concat(t?": ".concat(t):"")),this.model=e,this.name="未支持的模型"}}),e("RuntimeError",class extends Error{constructor(e){super(e),this.message=e,this.name="Runtime Error"}}));e("RuntimeModelError",class extends Error{constructor(e,t){super("「".concat(e.id,"」模型").concat(t?": ".concat(t):"")),this.model=e,this.name="模型配置缺失"}}),e("NoticeError",class extends Error{constructor(e,t){super(e),this.message=e,this.duration=t,this.name="notice Error"}});function Y(){return l(z.TOKEN)}var $=/<svg\b[^>]*>[\s\S]*?<\/svg>/;var X=e("Interceptor",class{async onBeforeRequest(e){return e}onRequestError(e){return Promise.reject(e)}async onResponseSuccess(e){return e}onResponseError(e){return Promise.reject(e)}use(e){this.requestTag=e.interceptors.request.use(this.onBeforeRequest,this.onRequestError),this.responseTag=e.interceptors.response.use(this.onResponseSuccess,this.onResponseError)}eject(e){this.requestTag&&e.interceptors.request.eject(this.requestTag),this.responseTag&&e.interceptors.response.eject(this.responseTag)}}),G=e("CoreInterceptor",class extends X{async onBeforeRequest(e){e=await super.onBeforeRequest(e);const{headers:t}=e;t.set("Authorization","Bearer ".concat(Y()));let n=ibiz.env.dcSystem;const{orgData:s}=ibiz;return s&&(s.systemid&&(n=s.systemid),s.orgid&&t.set("srforgid",s.orgid)),t.set("srfsystemid",n),e}}),K=class{constructor(e){this.parent=e,this.evt=new d(1e3)}next(e){this.evt.emit("all",e),this.parent&&this.nextParent(e)}nextParent(e){this.parent&&(this.parent.evt.emit("all",e),this.parent.nextParent(e))}on(e){this.evt.on("all",e)}off(e){this.evt.off("all",e)}},Z=class extends K{},Q=class extends K{sendCommand(e,t){const n={messageid:h(),messagename:"command",type:"COMMAND",subtype:t,data:e};this.next(n)}},ee=class extends Q{send(e){this.sendCommand(e,"OBJECTCREATED")}},te=class extends Q{send(e){this.sendCommand(e,"OBJECTUPDATED")}},ne=class extends Q{send(e){this.sendCommand(e,"OBJECTREMOVED")}},se=class extends Q{},re=class extends K{constructor(){super(...arguments),this.change=new se,this.create=new ee(this),this.update=new te(this),this.remove=new ne(this)}next(e){switch(e.subtype){case"OBJECTCREATED":this.create.next(e),this.change.next(e);break;case"OBJECTUPDATED":this.update.next(e),this.change.next(e);break;case"OBJECTREMOVED":this.remove.next(e),this.change.next(e);break;default:super.next(e)}}nextParent(e){switch(e.subtype){case"OBJECTCREATED":case"OBJECTUPDATED":case"OBJECTREMOVED":this.change.next(e)}super.nextParent(e)}send(e,t){const n={messageid:h(),messagename:"command",type:"COMMAND",subtype:t,data:e};this.next(n)}},oe=class extends K{send(e){const t={messageid:h(),messagename:"console",type:"CONSOLE",data:e};this.next(t)}},ie=e("MessageCenter",class{constructor(){this.all=new Z,this.command=new re(this.all),this.console=new oe(this.all)}next(e){"COMMAND"===e.type?this.command.next(e):"CONSOLE"===e.type?this.console.next(e):this.all.next(e)}on(e){this.all.on(e)}off(e){this.all.off(e)}});function ae(e,t,n,s,r){let o="".concat(e,"-").concat(t);return n&&(o+="-".concat(n)),s&&(o+="__".concat(s)),r&&(o+="--".concat(r)),o}e("Namespace",class{constructor(e,t){this.block=e,this.namespace=t||"ibiz"}b(e=""){return ae(this.namespace,this.block,e,"","")}e(e){return e?ae(this.namespace,this.block,"",e,""):""}m(e){return e?ae(this.namespace,this.block,"","",e):""}be(e,t){return e&&t?ae(this.namespace,this.block,e,t,""):""}em(e,t){return e&&t?ae(this.namespace,this.block,"",e,t):""}bm(e,t){return e&&t?ae(this.namespace,this.block,e,"",t):""}bem(e,t,n){return e&&t&&n?ae(this.namespace,this.block,e,t,n):""}is(e,t){return e&&t?"".concat("is-").concat(e):""}cssVar(e){const t={};for(const n in e)e[n]&&(t[this.cssVarName(n)]=e[n]);return t}cssVarBlock(e){const t={};for(const n in e)e[n]&&(t[this.cssVarBlockName(n)]=e[n]);return t}cssVarName(e){return"--".concat(this.namespace,"-").concat(e)}cssVarBlockName(e){return"--".concat(this.namespace,"-").concat(this.block,"-").concat(e)}}),e("HttpResponse",class{constructor(e,t,n){this.local=!0,this.ok=!1,this.headers={},this.config={headers:new p},this.data=e,this.status=t||200,this.statusText=n||"",this.status>=200&&this.status<300&&(this.ok=!0)}});var ce=e("Net",class{constructor(e){this.urlReg=/^http[s]?:\/\/[^\s]*/,this.waitRequest=new Map,this.interceptors=new Map,this.instance=f.create(e),this.addInterceptor("Default",new G)}get baseUrl(){return this.instance.defaults.baseURL||"".concat(ibiz.env.baseUrl,"/").concat(ibiz.env.appId)}addInterceptor(e,t){t.use(this.instance),this.interceptors.set(e,t)}removeInterceptor(e){const t=this.interceptors.get(e);t&&(t.eject(this.instance),this.interceptors.delete(e))}get presetConfig(){return{baseURL:this.baseUrl,headers:{"Content-Type":"application/json;charset=UTF-8",Accept:"application/json"}}}mergeConfig(...e){const t=this.presetConfig;if(0===e.length)return t;const{url:n}=e[0];return n&&this.urlReg.test(n)&&delete t.baseURL,i(t,...e)}async post(e,t,n={},s={}){e=this.handleAppPresetParam(e,n);try{const n=await this.request(e,{method:"post",data:t,headers:s});return this.doResponseResult(n)}catch(e){throw new W(e)}}async get(e,t={},n={},s={}){e=this.attachUrlParam(e,t);try{const t=await this.request(e,i({method:"get",headers:n},s));return this.doResponseResult(t)}catch(e){throw new W(e)}}async delete(e,t,n={}){e=this.handleAppPresetParam(e,t);try{const t=await this.request(e,{method:"delete",headers:n});return this.doResponseResult(t)}catch(e){throw new W(e)}}async put(e,t,n={},s={}){e=this.handleAppPresetParam(e,n);try{const n=await this.request(e,{method:"put",data:t,headers:s});return this.doResponseResult(n)}catch(e){throw new W(e)}}async getModel(e,t={}){try{const n=await this.instance.get(e,{headers:t});return this.doResponseResult(n)}catch(e){throw new W(e)}}async request(e,t={}){const n=this.mergeConfig({url:e},t),s=JSON.stringify(n);try{let e=null;this.waitRequest.has(s)?e=this.waitRequest.get(s):(e=this.instance.request(n),this.waitRequest.set(s,e));const t=await e;return this.waitRequest.has(s)&&this.waitRequest.delete(s),this.doResponseResult(t)}catch(e){throw this.waitRequest.has(s)&&this.waitRequest.delete(s),new W(e)}}axios(e){return f(e)}async sse(e,t,n={}){e=this.attachUrlParam(this.baseUrl+e,t),n.headers||(n.headers={});const s=n.headers;{s.Authorization="Bearer ".concat(Y());let e=ibiz.env.dcSystem;const{orgData:t}=ibiz;t&&(t.systemid&&(e=t.systemid),t.orgid&&(s.srforgid=t.orgid)),s.srfsystemid=e}const o=r({openWhenHidden:!0,method:"POST"},n);await N(e,o)}doResponseResult(e){const t=e;return t.status>=200&&t.status<=299&&(t.ok=!0),t}handleAppPresetParam(e,t){if(t){return Object.keys(t).forEach((e=>{e.startsWith("srf")&&u(t[e])&&t[e]})),this.attachUrlParam(e,t)}return e}attachUrlParam(e,t){const n=m(t);return u(n)&&(e=e.endsWith("?")||-1!==e.indexOf("?")&&e.endsWith("&")?"".concat(e).concat(n):-1===e.indexOf("?")||e.endsWith("&")?"".concat(e,"?").concat(n):"".concat(e,"&").concat(n)),e}}),le=e("StringUtil",class{static fill(e,t,n){if(u(e)){if(u(t)){const n=e.match(this.contextReg);null==n||n.forEach((n=>{const s=n.slice(10,n.length-1);e=e.replace("${context.".concat(s,"}"),t[s]||"")}))}if(u(n)){const t=e.match(this.dataReg);null==t||t.forEach((t=>{const s=t.slice(7,t.length-1);e=e.replace("${data.".concat(s,"}"),n[s]||"")}))}}return e}});le.contextReg=/\$\{context.[a-zA-Z_$][a-zA-Z0-9_$]{1,}\}/g,le.dataReg=/\$\{data.[a-zA-Z_$][a-zA-Z0-9_$]{1,}\}/g;e("UrlHelper",class{static get routeBase(){const e=window.location.href.lastIndexOf("#/");return window.location.href.slice(0,e+1)}static get appBase(){const{origin:e,pathname:t}=window.location;return"".concat(e).concat(t).replace(/\/$/,"")}static get routePath(){return window.location.hash.replace("#","")}static get fullPath(){return window.location.href}});function ue(e){const t=e.composedPath&&e.composedPath()||e.path;if(null!=t)return t;return[e.target].concat(function e(t,n=[]){const s=t.parentNode;return s?e(s,n.concat([s])):n}(e.target))}function he(e,t,n,s={}){e.addEventListener(t,n,s);let r=()=>{e.removeEventListener(t,n,s),r=B};return()=>{r()}}function de(e,t){return t&&(e.target===t||ue(e).includes(t))}var pe="undefined"!=typeof window?window:void 0;var fe=Math.round;function me(e){const t=e.length,n=[];if("rgb"===e.slice(0,3).toLowerCase()){const t=e.match(/([\d|.%]{1,3})/g);n[0]=parseInt(t[0],10),n[1]=parseInt(t[1],10),n[2]=parseInt(t[2],10),n[3]=t[3]?-1!==t[3].indexOf("%")?parseInt(t[3],10)/100:parseFloat(t[3]):1}else{let s;s=t<6?parseInt(String(e[1])+e[1]+e[2]+e[2]+e[3]+e[3]+(t>4?String(e[4])+e[4]:""),16):parseInt(e.slice(1),16),n[0]=s>>16&255,n[1]=s>>8&255,n[2]=255&s,n[3]=9===t||5===t?fe((s>>24&255)/255*1e4)/1e4:1}return n}function ge(e){let t="";switch(e.split(".").pop()){case".wps":t="application/kswps";break;case".doc":t="application/msword";break;case".docx":t="application/vnd.openxmlformats-officedocument.wordprocessingml.document";break;case".txt":t="text/plain";break;case".zip":t="application/zip";break;case".png":t="image/png";break;case".gif":t="image/gif";break;case".jpeg":case".jpg":t="image/jpeg";break;case".rtf":t="application/rtf";break;case".avi":t="video/x-msvideo";break;case".gz":t="application/x-gzip";break;case".tar":t="application/x-tar";break;case".xlsx":t="application/vnd.ms-excel";break;default:t=""}return t}function we(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n]);return t}function ve(e){const t=i({multiple:!0,accept:""},e),n=document.createElement("input");n.setAttribute("type","file"),n.setAttribute("multiple","".concat(t.multiple)),n.setAttribute("accept",t.accept),n.onchange=e=>{const n=e.target,s=n.files?we(n.files):[];0!==s.length&&(t.onSelected(s),n.value="")},document.body.appendChild(n),n.click(),document.body.removeChild(n)}e("CountLatch",class{constructor(){this.promise=null,this.resolve=null,this.count=0}startPromise(){this.promise=new Promise((e=>{this.resolve=e}))}endPromise(){this.resolve&&(this.resolve(),this.resolve=null,this.promise=null)}lock(){this.count+=1,this.promise||this.startPromise()}unlock(){if(this.count<1)throw new J("lock和unlock次数不匹配!");this.count-=1,0===this.count&&this.endPromise()}async await(){this.promise&&await this.promise}});var ye={childrenFields:["children"]},be=new Error("中断操作");function Ee(e,t,n){try{!function(e,t,n){const{childrenFields:s}=r(ye,n||{}),o=function(e,t){var n;for(const s of t)if(null==(n=e[s])?void 0:n.length)return e[s]}(e,s);if(null==o?void 0:o.length)for(const e of o){if(t(e))throw be;Ee(e,t,n)}}(e,t,n)}catch(e){if(e!==be)throw e}}var xe={...ye,compareField:"name"};e("DataTypes",class{static isNumber(e){return["BIGINT","BINARY","DECIMAL","FLOAT","INT","MONEY","NUMERIC","REAL","SMALLINT","SMALLMONEY","TINYINT","VARBINARY"].includes(this.toString(e))}static isDate(e){return["DATETIME","SMALLDATETIME","DATE","TIME"].includes(this.toString(e))}static toString(e){return this.typeMap[e]}}).typeMap={0:"UNKNOWN",1:"BIGINT",2:"BINARY",3:"BIT",4:"CHAR",5:"DATETIME",6:"DECIMAL",7:"FLOAT",8:"IMAGE",9:"INT",10:"MONEY",11:"NCHAR",12:"NTEXT",13:"NVARCHAR",14:"NUMERIC",15:"REAL",16:"SMALLDATETIME",17:"SMALLINT",18:"SMALLMONEY",19:"SQL_VARIANT",20:"SYSNAME",21:"TEXT",22:"TIMESTAMP",23:"TINYINT",24:"VARBINARY",25:"VARCHAR",26:"UNIQUEIDENTIFIER",27:"DATE",28:"TIME",29:"BIGDECIMAL"};var Re=R(T(),1),Te=R(O(),1),Oe=Re.noConflict();Te.reg(Oe),Te.apply(Oe);var Ce=e("IBizSys",class{constructor(){this.env=V,this.log=Oe,this.net=new ce,this.commands=new F,this.mc=new ie}})}}}));
2
2
  //# sourceMappingURL=index.system.min.js.map