ddan-js 2.9.11 → 2.9.13
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/bin/t-hook.js +1 -0
- package/bin/t-hook.mjs +1 -0
- package/bin/{tiny/utils.d.ts → t-utils.d.ts} +2 -2
- package/bin/t-utils.js +1 -0
- package/bin/t-utils.mjs +1 -0
- package/bin/t-web.js +1 -0
- package/bin/t-web.mjs +1 -0
- package/bin/tiny/t-utils.d.ts +239 -0
- package/bin/tiny/t-web.d.ts +114 -0
- package/package.json +16 -5
- package/bin/ddan-tiny.js +0 -1
- package/bin/lib/class/event.js +0 -1
- package/bin/lib/class/getset.js +0 -1
- package/bin/lib/class/icon.js +0 -1
- package/bin/lib/class/persist.js +0 -1
- package/bin/lib/class/pipeTask.js +0 -1
- package/bin/lib/class/store.js +0 -1
- package/bin/lib/common/_Symbol.js +0 -1
- package/bin/lib/common/_freeGlobal.js +0 -1
- package/bin/lib/common/_object.js +0 -1
- package/bin/lib/common/_root.js +0 -1
- package/bin/lib/common/internal/asciiToArray.js +0 -1
- package/bin/lib/common/internal/castSlice.js +0 -1
- package/bin/lib/common/internal/createCaseFirst.js +0 -1
- package/bin/lib/common/internal/hasUnicode.js +0 -1
- package/bin/lib/common/internal/nodeTypes.js +0 -1
- package/bin/lib/common/internal/slice.js +0 -1
- package/bin/lib/common/internal/stringToArray.js +0 -1
- package/bin/lib/common/internal/unicodeToArray.js +0 -1
- package/bin/lib/common/internal/unicodeWords.js +0 -1
- package/bin/lib/modules/convert/base.js +0 -1
- package/bin/lib/modules/convert/base64.js +0 -1
- package/bin/lib/modules/convert/index.js +0 -1
- package/bin/lib/modules/convert/md5.js +0 -1
- package/bin/lib/modules/convert/pkcs.js +0 -1
- package/bin/lib/modules/convert/utf8.js +0 -1
- package/bin/lib/modules/crypto/base64.js +0 -1
- package/bin/lib/modules/crypto/const.js +0 -1
- package/bin/lib/modules/crypto/index.js +0 -1
- package/bin/lib/modules/crypto/rsa.js +0 -1
- package/bin/lib/modules/crypto/tea.js +0 -1
- package/bin/lib/modules/crypto/uuid.js +0 -1
- package/bin/lib/modules/css.js +0 -1
- package/bin/lib/modules/fetch.js +0 -1
- package/bin/lib/modules/gbk.js +0 -1
- package/bin/lib/modules/hook/base.js +0 -1
- package/bin/lib/modules/hook/hooker.js +0 -1
- package/bin/lib/modules/hook/index.js +0 -1
- package/bin/lib/modules/hook/log.js +0 -1
- package/bin/lib/modules/hook/modules/bezier.js +0 -1
- package/bin/lib/modules/hook/modules/debounce.js +0 -1
- package/bin/lib/modules/hook/modules/mutex.js +0 -1
- package/bin/lib/modules/hook/modules/pipeline.js +0 -1
- package/bin/lib/modules/hook/modules/polling.js +0 -1
- package/bin/lib/modules/hook/modules/safeTask.js +0 -1
- package/bin/lib/modules/hook/modules/throttle.js +0 -1
- package/bin/lib/modules/html.js +0 -1
- package/bin/lib/modules/http/index.js +0 -1
- package/bin/lib/modules/http/interceptor.js +0 -1
- package/bin/lib/modules/list/base.js +0 -1
- package/bin/lib/modules/list/index.js +0 -1
- package/bin/lib/modules/math/index.js +0 -1
- package/bin/lib/modules/node/rsa-web.js +0 -1
- package/bin/lib/modules/obj/index.js +0 -1
- package/bin/lib/modules/qs/decode.js +0 -1
- package/bin/lib/modules/qs/encode.js +0 -1
- package/bin/lib/modules/qs/index.js +0 -1
- package/bin/lib/modules/regex.js +0 -1
- package/bin/lib/modules/rsa.js +0 -1
- package/bin/lib/modules/rule/async-validator/index.js +0 -1
- package/bin/lib/modules/rule/async-validator/messages.js +0 -1
- package/bin/lib/modules/rule/async-validator/rule/enum.js +0 -1
- package/bin/lib/modules/rule/async-validator/rule/index.js +0 -1
- package/bin/lib/modules/rule/async-validator/rule/pattern.js +0 -1
- package/bin/lib/modules/rule/async-validator/rule/range.js +0 -1
- package/bin/lib/modules/rule/async-validator/rule/required.js +0 -1
- package/bin/lib/modules/rule/async-validator/rule/type.js +0 -1
- package/bin/lib/modules/rule/async-validator/rule/url.js +0 -1
- package/bin/lib/modules/rule/async-validator/rule/whitespace.js +0 -1
- package/bin/lib/modules/rule/async-validator/util.js +0 -1
- package/bin/lib/modules/rule/async-validator/validator/any.js +0 -1
- package/bin/lib/modules/rule/async-validator/validator/array.js +0 -1
- package/bin/lib/modules/rule/async-validator/validator/boolean.js +0 -1
- package/bin/lib/modules/rule/async-validator/validator/date.js +0 -1
- package/bin/lib/modules/rule/async-validator/validator/enum.js +0 -1
- package/bin/lib/modules/rule/async-validator/validator/float.js +0 -1
- package/bin/lib/modules/rule/async-validator/validator/index.js +0 -1
- package/bin/lib/modules/rule/async-validator/validator/integer.js +0 -1
- package/bin/lib/modules/rule/async-validator/validator/method.js +0 -1
- package/bin/lib/modules/rule/async-validator/validator/number.js +0 -1
- package/bin/lib/modules/rule/async-validator/validator/object.js +0 -1
- package/bin/lib/modules/rule/async-validator/validator/pattern.js +0 -1
- package/bin/lib/modules/rule/async-validator/validator/regexp.js +0 -1
- package/bin/lib/modules/rule/async-validator/validator/required.js +0 -1
- package/bin/lib/modules/rule/async-validator/validator/string.js +0 -1
- package/bin/lib/modules/rule/async-validator/validator/type.js +0 -1
- package/bin/lib/modules/rule/index.js +0 -1
- package/bin/lib/modules/string/index.js +0 -1
- package/bin/lib/modules/string/words.js +0 -1
- package/bin/lib/modules/time/const.js +0 -1
- package/bin/lib/modules/time/dtime.js +0 -1
- package/bin/lib/modules/time/frame.js +0 -1
- package/bin/lib/modules/time/index.js +0 -1
- package/bin/lib/tiny/hook.js +0 -1
- package/bin/lib/tiny/store.js +0 -1
- package/bin/lib/tiny/utils.js +0 -1
- package/bin/lib/tiny/web.js +0 -1
- package/bin/lib/tiny.js +0 -1
- package/bin/lib/util/function.js +0 -1
- package/bin/lib/util/includes.js +0 -1
- package/bin/lib/util/index.js +0 -1
- package/bin/lib/util/is.js +0 -1
- package/bin/lib/util/to.js +0 -1
- package/bin/tiny.d.ts +0 -6
- /package/bin/{tiny/web.d.ts → t-web.d.ts} +0 -0
- /package/bin/tiny/{hook.d.ts → t-hook.d.ts} +0 -0
- /package/bin/tiny/{store.d.ts → t-store.d.ts} +0 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import Http from '../modules/http';
|
|
2
|
+
declare const dWeb: {
|
|
3
|
+
fetch: {
|
|
4
|
+
getDataURL: (url: string, cache?: RequestCache | undefined) => Promise<[any, undefined] | [null, {
|
|
5
|
+
contentType: string;
|
|
6
|
+
dataUrl: string;
|
|
7
|
+
}]>;
|
|
8
|
+
getArrayBuffer: (url: string, cache?: RequestCache | undefined) => Promise<[any, undefined] | [null, ArrayBuffer]>;
|
|
9
|
+
getJson: (url: string, cache?: RequestCache | undefined) => Promise<[any, undefined] | [null, any]>;
|
|
10
|
+
download: (url: string, opts?: {
|
|
11
|
+
success?: ((buffer: Uint8Array) => void) | undefined;
|
|
12
|
+
progress?: ((percentage: number, current: number, total: number) => void) | undefined;
|
|
13
|
+
fail?: ((error: Error) => void) | undefined;
|
|
14
|
+
}) => Promise<Uint8Array | undefined>;
|
|
15
|
+
getText: (url: string, cache?: RequestCache | undefined) => Promise<[any, undefined] | [null, string]>;
|
|
16
|
+
cache: (url: string, cache?: RequestCache) => Promise<[any, undefined] | [null, boolean]>;
|
|
17
|
+
};
|
|
18
|
+
Http: typeof Http;
|
|
19
|
+
css: {
|
|
20
|
+
stringify: (styleObj: Record<string, string | number>) => string;
|
|
21
|
+
parse: (styleStr: string, { camel, pure }?: {
|
|
22
|
+
camel?: boolean | undefined;
|
|
23
|
+
pure?: boolean | undefined;
|
|
24
|
+
}) => {} | undefined;
|
|
25
|
+
fixValue: (value: string | number, unit?: string) => string | number;
|
|
26
|
+
style: (cssKV: Record<string, any>, unit?: string) => string;
|
|
27
|
+
commonFields: string[];
|
|
28
|
+
};
|
|
29
|
+
qs: {
|
|
30
|
+
parse: (qs: any, { sep, eq, max, multiple, uri, parseNumber, parseBoolean }?: {
|
|
31
|
+
sep?: string | undefined;
|
|
32
|
+
eq?: string | undefined;
|
|
33
|
+
max?: number | undefined;
|
|
34
|
+
multiple?: boolean | undefined;
|
|
35
|
+
uri?: boolean | undefined;
|
|
36
|
+
parseNumber?: boolean | undefined;
|
|
37
|
+
parseBoolean?: boolean | undefined;
|
|
38
|
+
}) => {};
|
|
39
|
+
stringify: (obj: any, { sep, eq, name, uri, cleanZero, cleanNull, cleanWhitespace }?: {
|
|
40
|
+
sep?: string | undefined;
|
|
41
|
+
eq?: string | undefined;
|
|
42
|
+
name?: null | undefined;
|
|
43
|
+
uri?: boolean | undefined;
|
|
44
|
+
cleanZero?: boolean | undefined;
|
|
45
|
+
cleanNull?: boolean | undefined;
|
|
46
|
+
cleanWhitespace?: boolean | undefined;
|
|
47
|
+
}) => string;
|
|
48
|
+
https: (url: string) => string;
|
|
49
|
+
parseUrl: (url: string) => {
|
|
50
|
+
pathname: string;
|
|
51
|
+
params: {};
|
|
52
|
+
route: string;
|
|
53
|
+
page: string;
|
|
54
|
+
name: string;
|
|
55
|
+
withoutExtension: string;
|
|
56
|
+
extname: string;
|
|
57
|
+
href: string;
|
|
58
|
+
url: string;
|
|
59
|
+
origin: string;
|
|
60
|
+
host: string;
|
|
61
|
+
protocol: string;
|
|
62
|
+
port: string;
|
|
63
|
+
query: string;
|
|
64
|
+
};
|
|
65
|
+
parsePath: (url: string) => {
|
|
66
|
+
route: string;
|
|
67
|
+
page: string;
|
|
68
|
+
name: string;
|
|
69
|
+
withoutExtension: string;
|
|
70
|
+
extname: string;
|
|
71
|
+
};
|
|
72
|
+
parseHost: (url: string) => import("..").Ddan.IHttpHost;
|
|
73
|
+
join: (...args: string[]) => string;
|
|
74
|
+
shExpMatch: (text: string, pattern: string) => boolean;
|
|
75
|
+
isLocalIpAddress: (addr: string) => boolean;
|
|
76
|
+
parseFileUrl: (url: string) => {
|
|
77
|
+
href: string;
|
|
78
|
+
file: string;
|
|
79
|
+
url: string;
|
|
80
|
+
protocol: string;
|
|
81
|
+
host: string;
|
|
82
|
+
query: string;
|
|
83
|
+
params: {};
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
icon: import("../class/icon").DIcon;
|
|
87
|
+
html: {
|
|
88
|
+
dataURLtoFile: (dataurl: any, filename: any) => File;
|
|
89
|
+
dataURLtoBlob: (dataurl: any) => Blob;
|
|
90
|
+
blobToFile: (blob: any, fileName: string) => any;
|
|
91
|
+
readAsDataURL: (file: any, cb: any) => void;
|
|
92
|
+
downloadUrl: (url: string, filename?: string, checkSomeOrigin?: boolean) => void;
|
|
93
|
+
download: (urlOrFile: string | Blob | MediaSource, filename?: string) => void;
|
|
94
|
+
downloadFile: (data: Blob | MediaSource, filename?: string) => void;
|
|
95
|
+
downloadImage: (url: string) => Promise<void> | undefined;
|
|
96
|
+
watermark: (text: string, { width, height, angle, fillStyle, font, textAlign, textBaseline, }?: {
|
|
97
|
+
width?: number | undefined;
|
|
98
|
+
height?: number | undefined;
|
|
99
|
+
angle?: number | undefined;
|
|
100
|
+
fillStyle?: string | undefined;
|
|
101
|
+
font?: string | undefined;
|
|
102
|
+
textAlign?: "center" | "end" | "left" | "right" | "start" | undefined;
|
|
103
|
+
textBaseline?: "alphabetic" | "bottom" | "hanging" | "ideographic" | "middle" | "top" | undefined;
|
|
104
|
+
}) => string;
|
|
105
|
+
copyText: (text: string, legacy?: boolean) => Promise<boolean>;
|
|
106
|
+
queryPermission: (name: string, def?: PermissionState) => Promise<PermissionState>;
|
|
107
|
+
isAllowed: (status: PermissionState | undefined, prompt?: boolean) => boolean;
|
|
108
|
+
legacyCopy: (text: string) => boolean;
|
|
109
|
+
takeHtmlLinks: (htmlContent: string) => never[];
|
|
110
|
+
takeHtml: (htmlContent: string, regex: RegExp) => string[];
|
|
111
|
+
toBlobUrl: (part: BlobPart, mime: "application/javascript") => string;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
export default dWeb;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ddan-js",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.13",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ddan-js",
|
|
@@ -33,10 +33,20 @@
|
|
|
33
33
|
"import": "./bin/ddan-upload.mjs",
|
|
34
34
|
"require": "./bin/ddan-upload.js"
|
|
35
35
|
},
|
|
36
|
-
"./
|
|
37
|
-
"types": "./bin/
|
|
38
|
-
"import": "./bin/
|
|
39
|
-
"require": "./bin/
|
|
36
|
+
"./hook": {
|
|
37
|
+
"types": "./bin/t-hook.d.ts",
|
|
38
|
+
"import": "./bin/t-hook.mjs",
|
|
39
|
+
"require": "./bin/t-hook.js"
|
|
40
|
+
},
|
|
41
|
+
"./utils": {
|
|
42
|
+
"types": "./bin/t-utils.d.ts",
|
|
43
|
+
"import": "./bin/t-utils.mjs",
|
|
44
|
+
"require": "./bin/t-utils.js"
|
|
45
|
+
},
|
|
46
|
+
"./web": {
|
|
47
|
+
"types": "./bin/t-web.d.ts",
|
|
48
|
+
"import": "./bin/t-web.mjs",
|
|
49
|
+
"require": "./bin/t-web.js"
|
|
40
50
|
},
|
|
41
51
|
"./*": "./*"
|
|
42
52
|
},
|
|
@@ -125,6 +135,7 @@
|
|
|
125
135
|
"@types/babel__core": "7.1.19",
|
|
126
136
|
"@types/babel__traverse": "7.17.1",
|
|
127
137
|
"@types/jest": "^23.3.2",
|
|
138
|
+
"@types/lodash": "^4.17.13",
|
|
128
139
|
"@types/node": "^16.18.0",
|
|
129
140
|
"ali-oss": "^6.17.1",
|
|
130
141
|
"colors": "^1.4.0",
|
package/bin/ddan-tiny.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("crypto")):"function"==typeof define&&define.amd?define(["exports","crypto"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).dTiny=e.dTiny||{},e.crypto$1)}(this,(function(e,t){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=r(t);var o={toUtf8:e=>{if(!e)return"";const t=e.replace(/\r\n/g,"\n");let r="";for(let e=0;e<t.length;e++){let n=t.charCodeAt(e);n<128?r+=String.fromCharCode(n):n>127&&n<2048?(r+=String.fromCharCode(n>>6|192),r+=String.fromCharCode(63&n|128)):(r+=String.fromCharCode(n>>12|224),r+=String.fromCharCode(n>>6&63|128),r+=String.fromCharCode(63&n|128))}return r},fromUtf8:e=>{let t="",r=0;if(!e)return"";let n=0,o=0,s=0;for(;r<e.length;)n=e.charCodeAt(r),n<128?(t+=String.fromCharCode(n),r++):n>191&&n<224?(o=e.charCodeAt(r+1),t+=String.fromCharCode((31&n)<<6|63&o),r+=2):(o=e.charCodeAt(r+1),s=e.charCodeAt(r+2),t+=String.fromCharCode((15&n)<<12|(63&o)<<6|63&s),r+=3);return t},toUtf8Bytes:e=>{if(!e)return new Uint8Array;const t=e.replace(/\r\n/g,"\n"),r=[];for(let e=0;e<t.length;e++){let n=t.charCodeAt(e);n<128?r.push(n):n<2048?(r.push(n>>6|192),r.push(63&n|128)):(r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128))}return new Uint8Array(r)},fromUtf8Bytes:e=>{let t="",r=0;if(!e||e.length<=0)return"";for(;r<e.length;){let n=e[r];if(n<128)t+=String.fromCharCode(n),r++;else if(n>191&&n<224){const o=e[r+1];t+=String.fromCharCode((31&n)<<6|63&o),r+=2}else{const o=e[r+1],s=e[r+2];t+=String.fromCharCode((15&n)<<12|(63&o)<<6|63&s),r+=3}}return t}};const s="object"==typeof global&&null!==global&&global.Object===Object&&global,i="object"==typeof globalThis&&null!==globalThis&&globalThis.Object===Object&&globalThis,a="object"==typeof self&&null!==self&&self.Object===Object&&self,u=i||s||a||Function("return this")(),c=u.Symbol,{toString:l,hasOwnProperty:f,propertyIsEnumerable:d}=Object.prototype,h=c?c.toStringTag:void 0;function p(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":h&&h in Object(e)?function(e){const t=f.call(e,h),r=e[h];let n=!1;try{e[h]=void 0,n=!0}catch(e){}const o=l.call(e);return n&&(t?e[h]=r:delete e[h]),o}(e):l.call(e)}var g={getTag:p,getType:function(e){return(p(e).match(/\w+/g)||["object","Undefined"])[1]||""},toString:l,hasOwnProperty:f,propertyIsEnumerable:d};const y="object"==typeof e&&null!==e&&!e.nodeType&&e,m=y&&"object"==typeof module&&null!==module&&!module.nodeType&&module,b=m&&m.exports===y&&s.process,w=(()=>{try{const e=m&&m.require&&m.require("util").types;return e||b&&b.binding&&b.binding("util")}catch(e){}})();var v="[object Function]",x="[object GeneratorFunction]",A="[object AsyncFunction]",_=9007199254740991;const S=/^(?:0|[1-9]\d*)$/,O=u?.Buffer?.isBuffer,j=/^\[object (?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)Array\]$/,C=w&&w.isTypedArray;function k(e){const t=typeof e;return null!=e&&("object"==t||"function"==t)}function $(e){return null!=e&&"object"==typeof e}const E=Array.isArray;function B(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=_}(e.length)&&!T(e)}function q(e){return $(e)&&B(e)}function T(e){var t=k(e)?g.getTag(e):"";return t===v||t===x||t===A}function F(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Object.prototype)}function P(e){return q(e)&&g.hasOwnProperty.call(e,"callee")&&(!g.propertyIsEnumerable.call(e,"callee")||"[object Arguments]"==g.toString.call(e))}const L="undefined"!=typeof window&&void 0!==window.document,M="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,R=C?e=>C(e):e=>$(e)&&j.test(g.getTag(e)),U="function"==typeof O?O:()=>!1;var I={is:function(e,t){return g.getTag(e)===`[object ${t}]`},isNumber:function(e){return"[object Number]"===g.getTag(e)},isString:function(e){return"string"==typeof e||!E(e)&&$(e)&&"[object String]"==g.getTag(e)},isObject:k,isObjectLike:$,isPlainObject:function(e){if(!$(e)||"[object Object]"!=g.getTag(e))return!1;if(null===Object.getPrototypeOf(e))return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t},isSymbol:function(e){return"symbol"==typeof e||$(e)&&"[object Symbol]"===g.getTag(e)},isFunction:T,isArray:E,isArrayLikeObject:q,isIndex:function(e,t){return!!(t=null==t?_:t)&&("number"==typeof e||S.test(e))&&e>-1&&e%1==0&&e<t},isArrayLike:B,isPrototype:F,isArguments:P,isPromise:function(e){return"[object Promise]"===(k(e)?g.getTag(e):"")},isBrowser:L,isNode:M,isBlobOrBuffer:e=>e instanceof Blob||e instanceof ArrayBuffer,isUint8Array:e=>e instanceof Uint8Array,isArrayBuffer:e=>e instanceof ArrayBuffer,isEmpty:e=>{if(null==e)return!0;if(B(e)&&(Array.isArray(e)||"string"==typeof e||"function"==typeof e.splice||U(e)||R(e)||P(e)))return!e.length;const t=g.getTag(e);if("[object Map]"===t||"[object Set]"===t)return!e.size;if(F(e))return!Object.keys(e).length;for(const t in e)if(g.hasOwnProperty.call(e,t))return!1;return!0}};const z="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var D={toBase64:(e="")=>{let t,r,n,s,i,a,u,c="",l=0;for(e=o.toUtf8(e);l<e.length;)t=e.charCodeAt(l++),r=e.charCodeAt(l++),n=e.charCodeAt(l++),s=t>>2,i=(3&t)<<4|r>>4,a=(15&r)<<2|n>>6,u=63&n,isNaN(r)?a=u=64:isNaN(n)&&(u=64),c=c+z.charAt(s)+z.charAt(i)+z.charAt(a)+z.charAt(u);return c},fromBase64:(e="")=>{let t,r,n,s,i,a,u,c="",l=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");l<e.length;)s=z.indexOf(e.charAt(l++)),i=z.indexOf(e.charAt(l++)),a=z.indexOf(e.charAt(l++)),u=z.indexOf(e.charAt(l++)),t=s<<2|i>>4,r=(15&i)<<4|a>>2,n=(3&a)<<6|u,c+=String.fromCharCode(t),64!=a&&(c+=String.fromCharCode(r)),64!=u&&(c+=String.fromCharCode(n));return c=o.fromUtf8(c),c},bytesToBase64:e=>{let t,r,n,o,s,i,a,u="",c=0;if(!e||!I.isArrayLike(e)||!I.isUint8Array(e))return"";for(;c<e.length;)t=e[c++],r=e[c++],n=e[c++],o=t>>2,s=(3&t)<<4|r>>4,i=(15&r)<<2|n>>6,a=63&n,isNaN(r)?i=a=64:isNaN(n)&&(a=64),u=u+z.charAt(o)+z.charAt(s)+z.charAt(i)+z.charAt(a);return u},base64ToBytes:(e="")=>{let t,r,n,o,s,i,a,u=[],c=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");c<e.length;)o=z.indexOf(e.charAt(c++)),s=z.indexOf(e.charAt(c++)),i=z.indexOf(e.charAt(c++)),a=z.indexOf(e.charAt(c++)),t=o<<2|s>>4,r=(15&s)<<4|i>>2,n=(3&i)<<6|a,u.push(t),64!=i&&u.push(r),64!=a&&u.push(n);return new Uint8Array(u)}};function N(e){return Math.floor(Math.random()*e)}function K(e,t=10){return+parseFloat(Number(e).toExponential(t))}const V=180/Math.PI;var H={random:N,randomRange:function(e,t){return Math.floor(Math.random()*(t-e+1)+e)},lerp:function(e,t,r){return e*(1-r)+t*r},randoms:function(e,t=1,r=!1){const n=[];for(;;){if(n.length>=t)break;if(!r&&n.length>=e)break;const o=N(e);r?n.push(o):n.includes(o)||n.push(o)}return n},strip:K,float:function(e,{digits:t=2,fixed:r=!1}={}){const n=K(e).toFixed(t);return r||!t?+n:+n.replace(/(\.[1-9]?)0+$/,"$1").replace(/\.$/,"")},radian2degree:function(e){return e*V},degree2radian:function(e){return e/V},calcDataSize:function(e){const t={gb:0,mb:0,kb:0,b:0,total:e,desc:""},r=[{name:"gb",divisor:1<<30},{name:"mb",divisor:1<<20},{name:"kb",divisor:1024},{name:"b",divisor:1}];for(const n of r){const r=Math.floor(e/n.divisor);t[n.name]=r,e-=r*n.divisor}return t.gb>0?t.desc=(t.gb+t.mb/1024).toFixed(2)+"GB":t.mb>0?t.desc=(t.mb+t.kb/1024).toFixed(2)+"MB":t.kb>0?t.desc=(t.kb+t.b/1024).toFixed(2)+"KB":t.desc=t.b+"B",t}};var Z={bytes2str:e=>{if(!e||!I.isArrayLike(e))return"";return e.reduce(((e,t)=>e+String.fromCharCode(t)),"")},str2bytes:(e="")=>{const t=e,r=new Uint8Array(t.length);for(let e=0,n=t.length;e<n;e++)r[e]=t.charCodeAt(e);return r},str2hex:e=>{let t="";for(let r=0;r<e.length;r++)t+=e.charCodeAt(r).toString(16).padStart(2,"0");return t},hex2str:e=>{let t="";for(let r=0;r<e.length;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t},concatBytes:(...e)=>{const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);let n=0;for(const t of e)r.set(t,n),n+=t.length;return r},uint32ToBytes:e=>{const t=new Uint8Array(8);return t[0]=e[0]>>>24&255,t[1]=e[0]>>>16&255,t[2]=e[0]>>>8&255,t[3]=255&e[0],t[4]=e[1]>>>24&255,t[5]=e[1]>>>16&255,t[6]=e[1]>>>8&255,t[7]=255&e[1],t},bytesToUint32:e=>{const t=new Uint32Array(2);return t[0]=e[0]<<24|e[1]<<16|e[2]<<8|e[3],t[1]=e[4]<<24|e[5]<<16|e[6]<<8|e[7],t},hex2bytes:e=>{let t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++)t[r]=parseInt(e.substr(2*r,2),16);return t},bytes2hex:e=>Array.from(e).map((e=>e.toString(16).padStart(2,"0"))).join(""),toUint32:e=>{const t=Math.ceil(e.length/4),r=new Uint32Array(t);for(let n=0;n<t;n++)r[n]=e.charCodeAt(4*n)<<24|e.charCodeAt(4*n+1)<<16|e.charCodeAt(4*n+2)<<8|e.charCodeAt(4*n+3);return r},fromUint32:e=>{let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]>>>24&255,e[r]>>>16&255,e[r]>>>8&255,255&e[r]);return t.replace(/\0+$/,"")},flatten:function e(t,r=!1,n=[]){for(let o=0;o<t.length;o+=1){const s=t[o];r&&Array.isArray(s)?e(s,r,n):n.push(s)}return n}};var W={pkcs7Padding:(e,t)=>{const r=t-e.length%t,n=new Uint8Array(r).fill(r);return Z.concatBytes(e,n)},pkcs7Unpadding:e=>{const t=e[e.length-1];return e.slice(0,-t)}};function Q(e,t){return e<<t|e>>>32-t}function Y(e,t){let r,n,o,s,i;return o=2147483648&e,s=2147483648&t,r=1073741824&e,n=1073741824&t,i=(1073741823&e)+(1073741823&t),r&n?2147483648^i^o^s:r|n?1073741824&i?3221225472^i^o^s:1073741824^i^o^s:i^o^s}function J(e,t,r,n,o,s,i){return e=Y(e,Y(Y(function(e,t,r){return e&t|~e&r}(t,r,n),o),i)),Y(Q(e,s),t)}function G(e,t,r,n,o,s,i){return e=Y(e,Y(Y(function(e,t,r){return e&r|t&~r}(t,r,n),o),i)),Y(Q(e,s),t)}function X(e,t,r,n,o,s,i){return e=Y(e,Y(Y(function(e,t,r){return e^t^r}(t,r,n),o),i)),Y(Q(e,s),t)}function ee(e,t,r,n,o,s,i){return e=Y(e,Y(Y(function(e,t,r){return t^(e|~r)}(t,r,n),o),i)),Y(Q(e,s),t)}function te(e){let t,r,n="",o="";for(r=0;r<=3;r++)t=e>>>8*r&255,o="0"+t.toString(16),n+=o.substr(o.length-2,2);return n}function re(e){let t,r,n,o,s,i,a,u,c,l=[];for(l=function(e){let t;const r=e.length,n=r+8,o=16*((n-n%64)/64+1),s=Array(o-1).fill(0);let i=0,a=0;for(;a<r;)t=(a-a%4)/4,i=a%4*8,s[t]=s[t]|e[a]<<i,a++;return t=(a-a%4)/4,i=a%4*8,s[t]=s[t]|128<<i,s[o-2]=r<<3,s[o-1]=r>>>29,s}(e),i=1732584193,a=4023233417,u=2562383102,c=271733878,t=0;t<l.length;t+=16)r=i,n=a,o=u,s=c,i=J(i,a,u,c,l[t+0],7,3614090360),c=J(c,i,a,u,l[t+1],12,3905402710),u=J(u,c,i,a,l[t+2],17,606105819),a=J(a,u,c,i,l[t+3],22,3250441966),i=J(i,a,u,c,l[t+4],7,4118548399),c=J(c,i,a,u,l[t+5],12,1200080426),u=J(u,c,i,a,l[t+6],17,2821735955),a=J(a,u,c,i,l[t+7],22,4249261313),i=J(i,a,u,c,l[t+8],7,1770035416),c=J(c,i,a,u,l[t+9],12,2336552879),u=J(u,c,i,a,l[t+10],17,4294925233),a=J(a,u,c,i,l[t+11],22,2304563134),i=J(i,a,u,c,l[t+12],7,1804603682),c=J(c,i,a,u,l[t+13],12,4254626195),u=J(u,c,i,a,l[t+14],17,2792965006),a=J(a,u,c,i,l[t+15],22,1236535329),i=G(i,a,u,c,l[t+1],5,4129170786),c=G(c,i,a,u,l[t+6],9,3225465664),u=G(u,c,i,a,l[t+11],14,643717713),a=G(a,u,c,i,l[t+0],20,3921069994),i=G(i,a,u,c,l[t+5],5,3593408605),c=G(c,i,a,u,l[t+10],9,38016083),u=G(u,c,i,a,l[t+15],14,3634488961),a=G(a,u,c,i,l[t+4],20,3889429448),i=G(i,a,u,c,l[t+9],5,568446438),c=G(c,i,a,u,l[t+14],9,3275163606),u=G(u,c,i,a,l[t+3],14,4107603335),a=G(a,u,c,i,l[t+8],20,1163531501),i=G(i,a,u,c,l[t+13],5,2850285829),c=G(c,i,a,u,l[t+2],9,4243563512),u=G(u,c,i,a,l[t+7],14,1735328473),a=G(a,u,c,i,l[t+12],20,2368359562),i=X(i,a,u,c,l[t+5],4,4294588738),c=X(c,i,a,u,l[t+8],11,2272392833),u=X(u,c,i,a,l[t+11],16,1839030562),a=X(a,u,c,i,l[t+14],23,4259657740),i=X(i,a,u,c,l[t+1],4,2763975236),c=X(c,i,a,u,l[t+4],11,1272893353),u=X(u,c,i,a,l[t+7],16,4139469664),a=X(a,u,c,i,l[t+10],23,3200236656),i=X(i,a,u,c,l[t+13],4,681279174),c=X(c,i,a,u,l[t+0],11,3936430074),u=X(u,c,i,a,l[t+3],16,3572445317),a=X(a,u,c,i,l[t+6],23,76029189),i=X(i,a,u,c,l[t+9],4,3654602809),c=X(c,i,a,u,l[t+12],11,3873151461),u=X(u,c,i,a,l[t+15],16,530742520),a=X(a,u,c,i,l[t+2],23,3299628645),i=ee(i,a,u,c,l[t+0],6,4096336452),c=ee(c,i,a,u,l[t+7],10,1126891415),u=ee(u,c,i,a,l[t+14],15,2878612391),a=ee(a,u,c,i,l[t+5],21,4237533241),i=ee(i,a,u,c,l[t+12],6,1700485571),c=ee(c,i,a,u,l[t+3],10,2399980690),u=ee(u,c,i,a,l[t+10],15,4293915773),a=ee(a,u,c,i,l[t+1],21,2240044497),i=ee(i,a,u,c,l[t+8],6,1873313359),c=ee(c,i,a,u,l[t+15],10,4264355552),u=ee(u,c,i,a,l[t+6],15,2734768916),a=ee(a,u,c,i,l[t+13],21,1309151649),i=ee(i,a,u,c,l[t+4],6,4149444226),c=ee(c,i,a,u,l[t+11],10,3174756917),u=ee(u,c,i,a,l[t+2],15,718787259),a=ee(a,u,c,i,l[t+9],21,3951481745),i=Y(i,r),a=Y(a,n),u=Y(u,o),c=Y(c,s);return te(i)+te(a)+te(u)+te(c)}const ne=e=>{if("string"!=typeof e&&!(e instanceof Uint8Array))return"";return re("string"==typeof e?o.toUtf8Bytes(e):e)};var oe={md5:ne,md5Base64:e=>{const t=ne(e);if(!t)return"";const r=Z.hex2bytes(t);return D.bytesToBase64(r)}};const se=(e,t=!1)=>{const r=new Uint8Array(e);return t?D.bytesToBase64(r):r.reduce(((e,t)=>e+String.fromCharCode(t)),"")};var ie={...Z,...W,...o,...D,...oe,str2ab:(e="",t=!1)=>{if(t)return D.base64ToBytes(e).buffer;{const t=new ArrayBuffer(e.length),r=new Uint8Array(t);for(let t=0,n=e.length;t<n;t++)r[t]=e.charCodeAt(t);return t}},ab2str:se,utf8ToBase64:e=>I.isBrowser?btoa(e):Buffer.from(e,"utf-8").toString("base64"),base64ToUtf8:e=>I.isBrowser?atob(e):Buffer.from(e,"base64").toString("utf-8"),getRandomBytes:e=>{const t=new Uint8Array(e);for(let r=0;r<e;r++)t[r]=H.random(256);return t},textEncode:e=>o.toUtf8Bytes(e),textDecode:e=>o.fromUtf8Bytes(new Uint8Array(e)),toDataUrl:(e,t="text/plain")=>e?"string"==typeof e?`data:${t};base64,`+D.toBase64(e):I.isArrayBuffer(e)?`data:${t};base64,`+se(e,!0):"":""};const ae=NaN,ue=/^\s+|\s+$/g,ce=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,fe=/^0o[0-7]+$/i,de=parseInt,he=1/0,pe=17976931348623157e292;function ge(e){if("number"==typeof e)return e;if(I.isSymbol(e))return ae;if(I.isObject(e)){const t="function"==typeof e.valueOf?e.valueOf():e;e=I.isObject(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(ue,"");const t=le.test(e);return t||fe.test(e)?de(e.slice(2),t?2:8):ce.test(e)?ae:+e}function ye(e){return e?(e=ge(e))===he||e===-he?(e<0?-1:1)*pe:e==e?e:0:0===e?e:0}var me={toNumber:ge,toFinite:ye,toInteger:function(e){var t=ye(e),r=t%1;return t==t?r?t-r:t:0}};const be="Expected a function",we=Math.max,ve=Math.min;function xe(e,t=300,r={}){let n,o,s,i,a,u,c=0,l=!1,f=!1,d=!0;if("function"!=typeof e)throw new TypeError(be);function h(t){const r=n,s=o;return n=o=void 0,c=t,i=e.apply(s,r),i}function p(e){const r=e-u;return void 0===u||r>=t||r<0||f&&e-c>=s}function g(){const e=Date.now();if(p(e))return y(e);a=setTimeout(g,function(e){const r=t-(e-u);return f?ve(r,s-(e-c)):r}(e))}function y(e){return a=void 0,d&&n?h(e):(n=o=void 0,i)}function m(...e){const r=Date.now(),s=p(r);if(n=e,o=this,u=r,s){if(void 0===a)return function(e){return c=e,a=setTimeout(g,t),l?h(e):i}(u);if(f)return a=setTimeout(g,t),h(u)}return void 0===a&&(a=setTimeout(g,t)),i}return t=me.toNumber(t)||0,I.isObject(r)&&(l=!!r.leading,f="maxWait"in r,s=f?we(me.toNumber(r.maxWait)||0,t):s,d="trailing"in r?!!r.trailing:d),m.cancel=function(){void 0!==a&&clearTimeout(a),c=0,n=u=o=a=void 0},m.flush=function(){return void 0===a?i:y(Date.now())},m.pending=function(){return void 0!==a},m}class Ae{__list=[];constructor(e){this.push(e)}push(e){return e&&this.__list.push(e),this}clear(){return this.__list=[],this}_exec(e,t){let r;if(I.isFunction(e))r=e(t);else{if(I.isPromise(e))return e.then((e=>({...t,...e})));r=e}return I.isPromise(r)?r:Promise.resolve({...r,...t})}run(e){try{return this.__list.reduce(((e,t)=>e.then((e=>this._exec(t,e)))),Promise.resolve(e)).then((e=>[void 0,e])).catch((e=>[e,void 0]))}catch(e){return Promise.reject([e,void 0])}}}async function _e(e,t,r){return e.then((e=>(r&&r(),[null,e]))).catch((e=>(t&&Object.assign(e,t),r&&r(),[e,void 0])))}const Se=(e,t)=>{try{let r;return r=I.isFunction(e)?e():e,_e(Promise.resolve(r),void 0,t)}catch(e){return t&&t(),Promise.resolve([e,void 0])}},Oe=e=>"string"==typeof(e="function"==typeof e?e():e)?new Error(e):e;var je={to:_e,go:(e,t)=>Se(e,t),delay:(e=1e3)=>new Promise((t=>setTimeout(t,e))),safeRun:Se,toError:Oe,timeout:(e,t=0,r="timeout")=>{if(t<=0)return Se(e);let n;function o(){n&&clearTimeout(n)}const s=new Promise((e=>{o(),n=setTimeout((()=>e([Oe(r||"timeout"),void 0])),t)}));return Promise.race([Se(e,o),s])}};class Ce{__value=void 0;set(e){this.__value=e}get(){return this.__value}}var ke={singleton:function(){class e{static __instance__;constructor(){}static get Instance(){return e.__instance__||(e.__instance__=new this),e.__instance__}static get I(){return this.Instance}}return e},getset:function(e){const t=new Ce;return void 0!==e&&t.set(e),t}};class $e{_func;_callback;constructor(e,t){this._func=e,this._callback=t}async run(){return je.safeRun(this._func).then((e=>{try{this._callback&&this._callback(e)}catch(e){console.log("[ddan] task",e)}finally{return e}}))}}class Ee{__list=[];__count=0;__max=1;constructor(e=1){this.__count=0,this.__max=e>0?e:1,this.clear()}push(e,t){const r=new $e(e,t);return this.__list.push(r),this._step(),this}clear(){return this.__list=[],this.__count=0,this}_step(){if(this.__list.length<=0)return;if(this.__count>=this.__max)return;const e=this.__list.shift();e?(this.__count+=1,e?.run().finally((()=>{try{this.__count>0&&(this.__count-=1),this._step()}catch(e){console.error("[ddan] pipepine step finally",e)}}))):this._step()}async whenAll(){for(;;){if(this.__count<=0)break;await je.delay(100),this._step()}return this.clear()}}class Be extends(ke.singleton()){__lockedMap=new Map;pipeline=new Ee;constructor(){super()}lock(e,t){if(!e||!t)return;const r=je.safeRun(t);return this.__lockedMap.set(e,r),r}unlock(e){e&&this.__lockedMap.has(e)&&this.__lockedMap.delete(e)}async exec(e,t){if(!e||!t)return je.safeRun(e);const r=this.__lockedMap.get(t);if(r)return r;const n=this.lock(t,e);if(!n)return je.safeRun(e);const o=await n;return this.unlock(t),o}}const qe=e=>{try{const t=ie.ab2str(e,!0);return t.match(/.{1,64}/g)?.join("\n")||""}catch(e){return""}},Te=(e="",t="PUBLIC KEY")=>`-----BEGIN ${t}-----\n${e}\n-----END ${t}-----`;var Fe={RSAPublicKey:"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApiLWsPmoaiGdr02AmPYS\n4/VgxyJNNJSK2VICirXl4P8qAP3b/6GIs7Hwnsmmuj7gledJ0XiZodFjDNgQEZEG\nj4K9KX8NixcrJwnTQV5UebiERdj+64ihwqPVWo9dIOj43ZPJ8f4dritJv5tnQaBb\nb9zTkU3Ofzk1g8RU00Ith6quOGZcU2IWC4OQ+5YiZvzrCBKEvjFwK2OvGq43tI51\nGaZdI9H09jisypqefsMvv6esjEQQOtl+WGlI5fof7KZUt3dppvuDI4CYgeXIoKKL\n9T9qDl8F9aNSs3XHx32YyA7L1FraFD6PjqRjueIFp2emsXQcIMeMqqgVyV+4qb+0\nuwIDAQAB",RSAPrivateKey:"MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCmItaw+ahqIZ2v\nTYCY9hLj9WDHIk00lIrZUgKKteXg/yoA/dv/oYizsfCeyaa6PuCV50nReJmh0WMM\n2BARkQaPgr0pfw2LFysnCdNBXlR5uIRF2P7riKHCo9Vaj10g6Pjdk8nx/h2uK0m/\nm2dBoFtv3NORTc5/OTWDxFTTQi2Hqq44ZlxTYhYLg5D7liJm/OsIEoS+MXArY68a\nrje0jnUZpl0j0fT2OKzKmp5+wy+/p6yMRBA62X5YaUjl+h/splS3d2mm+4MjgJiB\n5cigoov1P2oOXwX1o1KzdcfHfZjIDsvUWtoUPo+OpGO54gWnZ6axdBwgx4yqqBXJ\nX7ipv7S7AgMBAAECggEAE1kuWLkSsJ2OoDpt9iJ+a7cJmNd5V1zPWOTwr9fkWFJP\nQYNPKlPVOFxKUivY84rcHAkuMyuQ9OQOXZISOQGDWpZW0mzeFmtR1r+Rr2S9gNmI\n6huOAL9OW306HUxiA7GuPhv2omy+Zyjac2q1WVLEI2B78Um2+WEfxuNIH7xu0gRR\nz/wluevMBQlv6hSeMESP6e9s2kB+FuM4bL7+1sexwS1TudKbHybujaiB8un9E2V3\nC9BkE6yf00Rhvii6Q4E4w3PFQfcBEFnjOD0S2Watx8GIbYjlYvtquy8Yj7OtyZB6\nw5sxyaYhKVVnkpGAbOgaCj94ABYF47VuwXr45I4PzQKBgQDp6svzD+QKlARjcWgO\nrH7UEpFX6m49G6Ib4c63xEg9+GesTgfDxoYxtXDKsC7I8OwMrmffJGbyfjaAvzmg\nicM3Y7kF6UPO9+q2mBRsyhoJSNONTeUVyoFSc+QDsVgndlTZIjqC5XLrONGaSPLJ\n7jJzqKhp3NQcpO8+xY0d7Efm1QKBgQC10fCNuF1LUTYgsWvvGxTiCCAIBurZmHU+\nGMb2Okfoco/P+QNl1jEba91AC7FudW3g/lRn0vTnDajlNoz2/CKunrTKN4/9lEBI\ntiwEOvhc5FtapRifSfrrNwFqPM+LijvOkcteWVhAUWCEP1eLmpnXGqfmZxnTaaVe\n5DyDgyAVTwKBgQDhEawfOQEANJ9sV2f6BnsZ7quuXcCoR3hZP5G5O8EO735BSesq\nsk/YcG4QeCjr6vQU15LWH552YH5srpHyJ9uP5gHW8DTwZZaPDhFJA8S9fjcfVP3B\nU9HO1fdknjTl83N8YPTPkZpbPZZfzyTcqrYclwFEqtfkn8YbLdW0Hu6n6QKBgDEv\njvS3uD1ExfDILlurptWSvx+Mx4F/1c+roj8/+u3t9+uaAIpPDE/PuTW3NBOens/r\n3WeM0QWkU1lWjYHPKY61jlDaARDnRxCkf3nRfhibCf+Wg/erar6wzagwtTCZf55d\nIHfwkYgsu4BrJkK02wMuydbxczIW9U6bTaeCFG7PAoGAN3oHYzTEBwZ7ZKv11QiQ\nEp/HeHBvD8fH/e1uVyBel4Co7NO5pV2s8qjS8+3+jxumKLNXCirjqwHo03YCdzxi\ncy4GFDsukHmDQ7FF9VC4QV0fJ0F7jGYE9nNZ+K9qwS5KrihOSBPxj0HptrF6TSOw\nBTSwr0byL3TC0m0StkSNKpo=",generateKeys:async e=>{try{const t=await e.generateKey({name:"RSA-OAEP",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:"SHA-256"},!0,["encrypt","decrypt"]),r=await window.crypto.subtle.exportKey("spki",t.publicKey),n=qe(r),o=Te(n,"PUBLIC KEY"),s=await window.crypto.subtle.exportKey("pkcs8",t.privateKey),i=qe(s);return{publicKey:n,publicKeyPem:o,privateKey:i,privateKeyPem:Te(i,"PRIVATE KEY")}}catch(e){return console.error("generateKeys failed:",e),{publicKey:"",publicKeyPem:"",privateKey:"",privateKeyPem:""}}},format_pem_key:Te,format_pem_content:qe,encrypt:async(e,t,r)=>{try{const n=(new TextEncoder).encode(t),o=await e.importKey("spki",ie.str2ab(r,!0),{name:"RSA-OAEP",hash:"SHA-256"},!0,["encrypt"]),s=[];for(let t=0;t<n.length;t+=190){let r=n.slice(t,t+190),i=await e.encrypt({name:"RSA-OAEP"},o,r);s.push(new Uint8Array(i))}const i=ie.concatBytes(...s);return ie.bytesToBase64(i)}catch(e){return console.error("[debug] encrypt",e),""}},decrypt:async(e,t,r)=>{try{const n=ie.base64ToBytes(t),o=await e.importKey("pkcs8",ie.str2ab(r,!0),{name:"RSA-OAEP",hash:"SHA-256"},!0,["decrypt"]),s=[],i=256;for(let t=0;t<n.length;t+=i){let r=n.slice(t,t+i),a=await e.decrypt({name:"RSA-OAEP"},o,r);s.push(new Uint8Array(a))}const a=ie.concatBytes(...s);return(new TextDecoder).decode(a)}catch(e){return console.error("decrypt failed:",e),""}}};const Pe=()=>n.default.webcrypto.subtle;var Le=async e=>Fe.encrypt(Pe(),e,Fe.RSAPublicKey),Me=async e=>Fe.decrypt(Pe(),e,Fe.RSAPrivateKey);const Re="undefined"!=typeof window?window.crypto.subtle:{};var Ue=async e=>Fe.encrypt(Re,e,Fe.RSAPublicKey),Ie=async e=>Fe.decrypt(Re,e,Fe.RSAPrivateKey);const ze=2654435769,De=(e,t)=>{let r=0;for(let n=0;n<32;n++)r=r+ze>>>0,e[0]=e[0]+((e[1]<<4)+t[0]^e[1]+r^(e[1]>>>5)+t[1])>>>0,e[1]=e[1]+((e[0]<<4)+t[2]^e[0]+r^(e[0]>>>5)+t[3])>>>0;return e},Ne=(e,t)=>{let r=3337565984;for(let n=0;n<32;n++)e[1]=e[1]-((e[0]<<4)+t[2]^e[0]+r^(e[0]>>>5)+t[3])>>>0,e[0]=e[0]-((e[1]<<4)+t[0]^e[1]+r^(e[1]>>>5)+t[1])>>>0,r=r-ze>>>0;return e},Ke=e=>{const t=ie.str2bytes(e),r=new Uint32Array(4);return r[0]=t[0]<<24|t[1]<<16|t[2]<<8|t[3],r[1]=t[4]<<24|t[5]<<16|t[6]<<8|t[7],r[2]=t[8]<<24|t[9]<<16|t[10]<<8|t[11],r[3]=t[12]<<24|t[13]<<16|t[14]<<8|t[15],r},Ve=(e,t)=>{const r=ie.pkcs7Padding(e,8),n=Ke(t),o=[];for(let e=0;e<r.length;e+=8){const t=ie.bytesToUint32(r.slice(e,e+8)),s=De(t,n);o.push(ie.uint32ToBytes(s))}return ie.concatBytes(...o)},He=(e,t)=>{const r=Ke(t),n=[];for(let t=0;t<e.length;t+=8){const o=ie.bytesToUint32(e.slice(t,t+8)),s=Ne(o,r);n.push(ie.uint32ToBytes(s))}const o=ie.concatBytes(...n);return ie.pkcs7Unpadding(o)};var Ze={TEAKey:"33576f37387276645054657a6831686e454664424e5652456f47794835795942",encrypt:De,decrypt:Ne,toTeaKey:Ke,encode:(e,t)=>{const r=ie.textEncode(e),n=Ve(r,t);return ie.bytesToBase64(n)},decode:(e,t)=>{const r=ie.base64ToBytes(e),n=He(r,t);return ie.textDecode(n.buffer)},encodeBytes:Ve,decodeBytes:He};function We(e,t,r){const{length:n}=e;return r=void 0===r?n:r,!t&&r>=n?e:function(e,t,r){let n=null==e?0:e.length;if(!n)return[];(t=null==t?0:t)<0&&(t=-t>n?0:n+t),(r=(r=void 0===r?n:r)>n?n:r)<0&&(r+=n),n=t>r?0:r-t>>>0,t>>>=0;let o=-1;const s=new Array(n);for(;++o<n;)s[o]=e[o+t];return s}(e,t,r)}const Qe=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff\\ufe0e\\ufe0f]");function Ye(e){return Qe.test(e)}const Je="\\ud800-\\udfff",Ge=`[${Je}]`,Xe="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff]",et="\\ud83c[\\udffb-\\udfff]",tt=`[^${Je}]`,rt="(?:\\ud83c[\\udde6-\\uddff]){2}",nt="[\\ud800-\\udbff][\\udc00-\\udfff]",ot=`${`(?:${Xe}|${et})`}?`,st="[\\ufe0e\\ufe0f]?",it=st+ot+`(?:\\u200d(?:${[tt,rt,nt].join("|")})${st+ot})*`,at=`(?:${[`${tt}${Xe}?`,Xe,rt,nt,Ge].join("|")})`,ut=RegExp(`${et}(?=${et})|${at+it}`,"g");function ct(e){return Ye(e)?function(e){return e.match(ut)||[]}(e):function(e){return e.split("")}(e)}function lt(e){return t=>{if(!t)return"";const r=Ye(t)?ct(t):void 0,n=r?r[0]:t[0],o=r?We(r,1).join(""):t.slice(1);return n[e]()+o}}const ft="\\ud800-\\udfff",dt="\\u2700-\\u27bf",ht="a-z\\xdf-\\xf6\\xf8-\\xff",pt="A-Z\\xc0-\\xd6\\xd8-\\xde",gt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",yt="['’]",mt=`[${gt}]`,bt=`[${dt}]`,wt=`[${ht}]`,vt=`[^${ft}${gt+"\\d"+dt+ht+pt}]`,xt="(?:\\ud83c[\\udde6-\\uddff]){2}",At="[\\ud800-\\udbff][\\udc00-\\udfff]",_t=`[${pt}]`,St=`(?:${wt}|${vt})`,Ot=`(?:${_t}|${vt})`,jt=`(?:${yt}(?:d|ll|m|re|s|t|ve))?`,Ct=`(?:${yt}(?:D|LL|M|RE|S|T|VE))?`,kt="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff]|\\ud83c[\\udffb-\\udfff])?",$t="[\\ufe0e\\ufe0f]?",Et=$t+kt+`(?:\\u200d(?:${[`[^${ft}]`,xt,At].join("|")})${$t+kt})*`,Bt=`(?:${[bt,xt,At].join("|")})${Et}`,qt=RegExp([`${_t}?${wt}+${jt}(?=${[mt,_t,"$"].join("|")})`,`${Ot}+${Ct}(?=${[mt,_t+St,"$"].join("|")})`,`${_t}?${St}+${jt}`,`${_t}+${Ct}`,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",Bt].join("|"),"g");const Tt=RegExp.prototype.test.bind(/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/),Ft=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Pt(e,t){if(void 0===t){const t=Tt(e)?function(e){return e.match(qt)}(e):function(e){return e.match(Ft)}(e);return t||[]}return e.match(t)||[]}function Lt(e){if(null==e)return"";if("string"==typeof e)return e;if(Array.isArray(e))return`${e.map((e=>null==e?e:Lt(e)))}`;if(I.isSymbol(e))return e.toString();const t=`${e}`;return"0"==t&&1/e==-Infinity?"-0":t}const Mt=lt("toUpperCase"),Rt=lt("toLowerCase");var Ut={toString:Lt,startCase:e=>Pt(`${e}`.replace(/['\u2019]/g,"")).reduce(((e,t,r)=>e+(r?" ":"")+Mt(t)),""),snakeCase:e=>Pt(Lt(e).replace(/['\u2019]/g,"")).reduce(((e,t,r)=>e+(r?"_":"")+t.toLowerCase()),""),kebabCase:e=>Pt(Lt(e).replace(/['\u2019]/g,"")).reduce(((e,t,r)=>e+(r?"-":"")+t.toLowerCase()),""),camelCase:e=>Pt(Lt(e).replace(/['\u2019]/g,"")).reduce(((e,t,r)=>(t=t.toLowerCase(),e+(r?Mt(t):t))),""),upperCase:e=>Pt(Lt(e).replace(/['\u2019]/g,"")).reduce(((e,t,r)=>e+(r?" ":"")+t.toUpperCase()),""),upperFirst:Mt,lowerCase:e=>Pt(Lt(e).replace(/['\u2019]/g,"")).reduce(((e,t,r)=>e+(r?" ":"")+t.toLowerCase()),""),lowerFirst:Rt,splitOnFirst:(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===e||""===t)return[];const r=e.indexOf(t);return-1===r?[]:[e.slice(0,r),e.slice(r+t.length)]},parseValue:(e,{number:t=!1,boolean:r=!1}={})=>{let n=e;return e&&"string"==typeof e?(t&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?n=Number(e):!r||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(n="true"===e.toLowerCase()),n):n},replace:(e,t)=>{if(!e)return e;if(!t)return e;let r=e;return((Array.isArray(t)?t:[t])||[]).forEach((e=>{e.key&&e.value&&(r=r.replace(new RegExp(e.key,e.flag||""),e.value))})),r},jsonFormat:e=>{try{if(!e)return"";const t=JSON.parse(e);return JSON.stringify(t,null,2)}catch(t){return e}},toLines:(e,t="\n")=>e?e.split(t).map((e=>e.trim())).filter((e=>!!e)):[]};var It={logString:e=>{try{const t=JSON.stringify(e);return void 0===t?"":Ze.encode(t,ie.hex2str(Ze.TEAKey))}catch(e){return""}},logParse:e=>{try{if(!e)return"";const t=Ze.decode(e,ie.hex2str(Ze.TEAKey));return Ut.jsonFormat(t)}catch(e){return""}},logRString:async e=>{try{const t=JSON.stringify(e);if(void 0===t)return"";return I.isBrowser?await Ue(t):await Le(t)}catch(e){return""}},logRParse:async e=>{try{if(!e)return"";const t=I.isBrowser?await Ie(e):await Me(e);return Ut.jsonFormat(t)}catch(e){return""}}};const zt=(e,t,r)=>e*(1-r)+t*r,Dt=(e,t,r)=>e===t?0:(r-e)/(t-e),Nt=(e,t,r)=>({x:zt(e.x,t.x,r),y:zt(e.y,t.y,r)}),Kt=(e,t,r,n)=>{const o=Nt(e,t,n),s=Nt(t,r,n);return Nt(o,s,n)},Vt=(e,t)=>{if(1===e.length)return e[0];const r=[];for(let n=0;n<e.length-1;n++)r.push({x:(1-t)*e[n].x+t*e[n+1].x,y:(1-t)*e[n].y+t*e[n+1].y});return Vt(r,t)},Ht=(e,t)=>{if(0===t||t===e)return 1;let r=1;for(let n=1;n<=t;n++)r=r*(e-n+1)/n;return r};var Zt={bezier1:Nt,bezier2:Kt,bezier3:(e,t,r,n,o)=>{const s=Kt(e,t,r,o),i=Kt(t,r,n,o);return Nt(s,i,o)},bezier:Vt,bezierCurve:(e,t)=>{const r=e.length-1;let n=0,o=0;for(let s=0;s<=r;s++){const i=Ht(r,s)*Math.pow(1-t,r-s)*Math.pow(t,s);n+=i*e[s].x,o+=i*e[s].y}return{x:n,y:o}},lerp:zt,lerpAverage:(e,t,r="")=>{if(e.length<=0)return 0;if(1===e.length)return e[0].x;if(2===e.length)return zt(e[0].y,e[1].y,.5);const n=[],o=e.slice().sort(((e,t)=>e.x-t.x)),s=o.length,i=o[0].x,a=o[s-1].x;for(let e=i;e<=a;e+=t){let t=0;for(let n=0;n<s-1;n++){const s=o[n],i=o[n+1];if(e>=s.x&&e<=i.x){if("lerp"===r){const r=Dt(s.x,i.x,e);t=Nt(s,i,r).y}else t=s.y;break}}e>o[s-1].x&&(t=o[s-1].y),n.push(t)}return n.reduce(((e,t)=>e+t),0)/n.length},proportion:Dt};var Wt={...je,...It,...Zt,sleep:je.delay,run:async function(e,t=0){if(t<=0)return je.safeRun(e);const r=t>0?Date.now():0,n=await je.safeRun(e),o=Date.now()-r;return o<t&&await je.delay(t-o),n},exec:(e,t="")=>Be.I.exec(e,t),debounce:xe,throttle:function(e,t=300,r={}){let n=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return I.isObject(r)&&(n=r.leading?!!r.leading:n,o=r.trailing?!!r.trailing:o),xe(e,t,{leading:n,maxWait:t,trailing:o})},task:e=>new Ae(e),mutex:function(e){var t=null;return async function(...r){if((t=this||t||{}).__ddMutex)return!1;t.__ddMutex=!0;try{e&&await Promise.resolve(e.apply(this,r))}catch(e){console.log(e)}finally{t.__ddMutex=!1}}},polling:async function(e={}){const{func:t,interval:r=100,times:n=1e3}=e;let o=n;const s=r<1?100:r;do{if(!t)break;const[e,r]=await je.to(Promise.resolve(t()));if(e||!1===r)break;o>0&&o--,0!==o&&await je.delay(s)}while(-1===n||o>0)},pipe:(e,t)=>Be.I.pipeline.push(e,t),pipeline:(e=1)=>new Ee(e),safeTask:(e,t)=>new $e(e,t)};const Qt=e=>{if(!e)return e;if("object"!=typeof e)return e;const t=Array.isArray(e)?[]:{};for(const r in e)e.hasOwnProperty(r)&&(t[r]=Qt(e[r]));return t};const Yt=(e,t,r={})=>{const n=e||{},{ignoreUndefined:o=!0,cover:s=!1}=r;if(!t)return n;for(const i in t){if(!t.hasOwnProperty(i))continue;const a=t[i];"object"!=typeof a||"object"!=typeof e[i]||s?o&&void 0===a||r.ignoreNull&&null===a||r.ignoreZero&&0===a||r.ignoreEmptyArray&&Array.isArray(a)&&a.length<=0||r.ignoreEmptyString&&"string"==typeof a&&""===a.trim()||(n[i]=a):n[i]=Jt(e[i],a,r)}return n},Jt=(e,t,r={})=>{let n={};return n=e&&"object"==typeof e&&!Array.isArray(e)?Yt(e,t,r):Yt({...e},t,r),n},Gt=(e,t,r={})=>Yt({...e},t,{cover:!0,...r}),Xt=(e,t,r,n,o=!1)=>{if(!e||!t||!r)return;let s=e[t];null!==s&&"object"==typeof s&&o&&Object.keys(s).forEach((e=>{Xt(s,e,r,n,o)})),Object.defineProperty(e,t,{configurable:!0,enumerable:!0,set:i=>{r.call(n,i,s),s=i,o&&Xt(e,t,r,n,o)},get:()=>s})};var er={copy:(e,t={})=>{if(void 0===e)return;const r=JSON.parse(JSON.stringify(e));if("object"!=typeof r)return r;if(Array.isArray(r))return r;const{fields:n=[],camel:o=!1,pure:s=!0}=t;if((!n||n.length<=0)&&!o)return r;const i={};for(const e in r){if(!r.hasOwnProperty(e))continue;const a=o?s&&e.startsWith("_")?e:Ut.camelCase(e):e;if(n.length>0&&!n.includes(e)&&!n.includes(a))continue;const u=r[e];t.ignoreNull&&null===u||(t.ignoreZero&&0===u||t.ignoreEmptyArray&&Array.isArray(u)&&u.length<=0||t.ignoreEmptyString&&"string"==typeof u&&""===u.trim()||(i[a]=u))}return i},clone:Qt,merge:Jt,isEmpty:e=>0!==e&&(!e||"object"==typeof e&&(Array.isArray(e)?!e.length:Object.keys(e).length<=0)),parseValue:(e,{number:t=!1,boolean:r=!1}={})=>{if(!e&&"object"!=typeof e)return e;for(const[n,o]of Object.entries(e))if("object"==typeof o&&null!==o)for(const[e,n]of Object.entries(o))o[e]=Ut.parseValue(n,{number:t,boolean:r});else e[n]=Ut.parseValue(o,{number:t,boolean:r});return e},cloneClass:function(e){return e?"object"!=typeof e?e:Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e)):e},combine:Gt,combines:(e,t={})=>{let r={};if(!e||e.length<=0)return r;const{ignoreUndefined:n=!0,ignoreNull:o=!0,ignoreZero:s=!0,ignoreEmptyArray:i=!0,ignoreEmptyString:a=!0,cover:u=!0}=t;return e.forEach((e=>r=Gt(r,e,{ignoreUndefined:n,ignoreNull:o,ignoreZero:s,ignoreEmptyArray:i,ignoreEmptyString:a,cover:u}))),r},observe:Xt,find:(e,t)=>{if(e&&"object"==typeof e)return Object.entries(e||{}).find((([e,r])=>!(!t||!t(e,r))))}};const tr=function(e,{sep:t="&",eq:r="=",max:n=1e3,multiple:o=!0,uri:s=!0,parseNumber:i=!1,parseBoolean:a=!1}={}){t=t||"&",r=r||"=";const u={};if("string"!=typeof e||0===e.length)return u;const c=/\+/g,l=n||1e3;let f=(e=e.split(t)).length;l>0&&f>l&&(f=l);for(let t=0;t<f;++t){let n,i,a,l,f=e[t].replace(c,"%20"),d=f.indexOf(r);d>=0?(n=f.substr(0,d),i=f.substr(d+1)):(n=f,i=""),a=s?decodeURIComponent(n):n,l=s?decodeURIComponent(i):i,g.hasOwnProperty.call(u,a)&&o?Array.isArray(u[a])?u[a].push(l):u[a]=[u[a],l]:u[a]=l}return er.parseValue(u,{number:i,boolean:a}),u},rr=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},nr=function(e,t=!0){return t?encodeURIComponent(e):e},or=function(e,{cleanZero:t=!1,cleanNull:r=!1,cleanWhitespace:n=!1}={}){return!(!t||0!==e)||(!(!r||null!=e)||!(!n||"string"!=typeof e||""!==e.trim()))},sr=/^(https?):\/\/([\w.\_\-]+)(?::(\d+))?/,ir=e=>{const t=(e||"").replace(/\\/g,"/").split("?")[0],r=t.match(/[\/]?([\w\_\-]+)[.]?[\w]*[?]?$/),n=r?r[1]:"",o=t.lastIndexOf("/")+1,s=t.substring(o),i=s.lastIndexOf("."),a=s.substring(0,i)||"",u=i>=0?s.substring(i):"";return{route:t.substring(0,o)||"",page:n,name:s,withoutExtension:a,extname:u}},ar=e=>{const t={href:e,url:"",origin:"",protocol:"",host:"",port:"",query:""};if(!e)return t;const r=e.match(sr);if(!r||r.length<4)return t;const n=r[3]||"",o=e.split("?");return t.url=o[0],t.origin=r[0],t.protocol=`${r[1]}:`,t.host=`${r[2]}${n?":"+n:""}`,t.port=n,t.query=o.length>1?o[1]:"",t},ur=(e,t)=>{if(e===t)return!0;if(!e)return!1;if(!t)return!1;if("*"===t)return!0;const r=t.replace(/\./g,"\\.").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp("^"+r+"$").test(e)};var cr={parse:tr,stringify:function(e,{sep:t="&",eq:r="=",name:n=null,uri:o=!0,cleanZero:s=!1,cleanNull:i=!1,cleanWhitespace:a=!1}={}){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(n){const u=nr(rr(n),o)+r,c=e[n];return Array.isArray(c)?c.map((function(e){return u+nr(rr(e),o)})).join(t):or(c,{cleanZero:s,cleanNull:i,cleanWhitespace:a})?"":u+nr(rr(c),o)})).filter(Boolean).join(t):n?nr(rr(n),o)+r+nr(rr(e),o):""},https:e=>e?e.replace(/^http[s]?/,"https"):e,parseUrl:e=>{const t=ar(e),{origin:r="",url:n="",query:o=""}=t,s=ir(n),i=tr(o,{multiple:!0,uri:!1});return{...t,...s,pathname:n.substring(n.indexOf(r||"")+r.length),params:i}},parsePath:ir,parseHost:ar,join:(...e)=>{const t=[];let r=!1;return e.forEach((e=>{const n=e.trim();if(""===n)return;if(/^(\w+):\/\//.test(n))return t.length=0,t.push(n),void(r=!0);n.split("/").forEach((e=>{"."!==e&&""!==e&&(".."===e?t.length>0&&".."!==t[t.length-1]?t.pop():r||t.push(".."):t.push(e))}))})),t.join("/")},shExpMatch:ur,isLocalIpAddress:e=>!!e&&!!(ur(e,"127.0.0.1")||ur(e,"localhost")||ur(e,"192.168.*.*")),parseFileUrl:e=>{const t={href:e,file:"",url:"",protocol:"",host:"",query:"",params:{}};if(!e)return t;let r=e?e.replace(/\\/g,"/"):"";r.startsWith("file://")&&!r.startsWith("file:///")?r="file:///"+r.slice(7):r.startsWith("file:/")&&!r.startsWith("file:///")&&(r="file:///"+r.slice(6));const n=r.match(/^file:\/\/(?:([^\/\\]+))?(\/.*)?$/);if(!n||n.length<3)return t;t.protocol="file:";const o=n[1]||"",s=n[2]||"";t.host=o;const i=s.split("?");return t.url=t.protocol+`//${t.host}`+i[0],t.file=i[0],t.query=i.length>1?i[1]:"",t.params=tr(t.query,{multiple:!0,uri:!1}),t}};const lr="0123456789",fr="abcdefghijklmnopqrstuvwxyz",dr="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var hr={keyNumber:lr,keyLower:fr,keyUpper:dr,keyChars:lr+fr+dr};const pr=(e=0,t=0)=>{const r=hr.keyChars.split(""),n=[];let o;if(t=t||r.length,e)for(o=0;o<e;o++)n[o]=r[0|Math.random()*t];else{let e;for(n[8]=n[13]=n[18]=n[23]="-",n[14]="4",o=0;o<36;o++)n[o]||(e=0|16*Math.random(),n[o]=r[19==o?3&e|8:e])}return n.join("")};class gr{__map;__tagList;__eventId="";constructor(){this.__map=new Map,this.__tagList=[],this.__eventId=pr()}clear(){return this.__map.clear(),this}on(e,t,r=""){if(!e||!t)return this;let n=this.__map.get(e);return n||(n=new Set,this.__map.set(e,n)),n.add(t),r&&this.__tagList.push({name:e,listener:t,tag:r}),this}emit(e,...t){if(!e)return this;const r=this.__map.get(e);if(!r)return this;return[...r].forEach((e=>e&&e(...t))),this}off(e,t){if(!e||!t)return this;this.__tagList=this.__tagList.filter((r=>r.name!==e||r.listener!==t));const r=this.__map.get(e);return r?(r.delete(t),r.size<=0&&this.__map.delete(e),this):this}remove(e){return e?(this.__tagList=this.__tagList.filter((t=>t.name!==e)),this.__map.delete(e),this):this}removeByTag(e){if(!e)return this;return this.__tagList.filter((t=>t.tag===e)).forEach((e=>{this.off(e.name,e.listener)})),this.__tagList=this.__tagList.filter((t=>t.tag!==e)),this}once(e,t){const r=(...n)=>{t(...n),this.off(e,r)};return this.on(e,r),this}has(e){return this.__map.has(e)}}class yr{_loopTimer;_event=new gr;started=!1;interval=0;constructor(e=0){this.interval=e||500}start(){return this.started||(this.stop(),this._loopTimer=setInterval((()=>{this._handleLoop()}),this.interval),this.started=!0),this}stop(){return this._loopTimer?(clearInterval(this._loopTimer),this._loopTimer=0,this.started=!1,this):this}restart(){return this.stop(),this.start(),this}on(e){return this._event.on("frame",e),this}off(e){return e?(this._event.off("frame",e),this):this}_handleLoop(){this._event.emit("frame")}}var mr={oneDay:864e5,oneHour:36e5,oneMinute:6e4,oneSecond:1e3};class br{date;timestamp=0;yyyy=0;yy="";M=0;MM="";d=0;dd="";h=0;hh="";m=0;mm="";s=0;ss="";S=0;SS="";SSS="";constructor(e){if(!e)return;const t="string"==typeof e||"number"==typeof e?new Date(e):e;t&&(this.date=t,this.timestamp=t.getTime(),this.toDate())}toDate(){return this.date?(this.yyyy=this.date.getFullYear(),this.yy=`${this.yyyy}`.substr(2),this.M=this.date.getMonth()+1,this.MM=(this.M<10?"0":"")+this.M,this.d=this.date.getDate(),this.dd=(this.d<10?"0":"")+this.d,this.h=this.date.getHours(),this.hh=(this.h<10?"0":"")+this.h,this.m=this.date.getMinutes(),this.mm=(this.m<10?"0":"")+this.m,this.s=this.date.getSeconds(),this.ss=(this.s<10?"0":"")+this.s,this.S=this.date.getMilliseconds(),this.SS=(this.S<10?"0":"")+this.S,this.SSS=this.S.toString().padStart(3,"0"),this):this}toCountdown(e=""){const t={countdown:0,timestamp:0,seconds:0,d:0,dd:"",h:0,hh:"",m:0,mm:"",s:0,ss:"",S:0,SS:"",SSS:"",desc:""};if(!this.timestamp)return t;t.timestamp=this.timestamp,t.countdown=Math.max(t.timestamp-Date.now(),0),t.seconds=Math.floor(t.countdown/mr.oneSecond);let r=t.countdown;t.d=Math.floor(r/mr.oneDay),t.dd=(t.d<10?"0":"")+t.d,r%=mr.oneDay,t.h=Math.floor(r/mr.oneHour),t.hh=(t.h<10?"0":"")+t.h,r%=mr.oneHour,t.m=Math.floor(r/mr.oneMinute),t.mm=(t.m<10?"0":"")+t.m,r%=mr.oneMinute,t.s=Math.floor(r/mr.oneSecond),t.ss=(t.s<10?"0":"")+t.s,r%=mr.oneSecond,t.S=r,t.SS=(t.S<10?"0":"")+t.S,t.SSS=t.S.toString().padStart(3,"0");let n=e;return n||(n=t.countdown>mr.oneHour?"hh:mm:ss":t.countdown>mr.oneMinute?"mm:ss":"ss"),t.desc=n.replace(/\bdd|d|hh|h|mm|m|ss|s|SSS|SS|S\b/g,(e=>t[e])),t}add(e=0){return e?(this.timestamp=this.timestamp+e,this.date=new Date(this.timestamp),this.toDate(),this):this}format(e="yyyy-MM-dd hh:mm:ss"){return e.replace(/\byyyy|yy|MM|M|dd|d|hh|h|mm|m|ss|s|SSS|SS|S\b/g,(e=>this[e]))}static get timezoneOffset(){return(new Date).getTimezoneOffset()/60}static getLocalTime(e=0){const t=new Date,r=t.getTime(),n=6e4*t.getTimezoneOffset();return new Date(r+n+36e5*e)}}const wr=(e,t="yyyy-MM-dd hh:mm:ss")=>{const r="string"==typeof e||"number"==typeof e?new Date(e):e;return r?vr(r).format(t):""},vr=e=>{const t="string"==typeof e||"number"==typeof e?new Date(e):e;return new br(t||0)};function xr({year:e=0,month:t=0,date:r=0,hour:n=0,minute:o=0,second:s=0}){const i=`${e||"yyyy"}/${t||"MM"}/${r||"dd"} ${n}:${o}:${s}`;return new Date(wr(Date.now(),i)).getTime()}var Ar={...mr,now:function(){return vr(new Date)},isToday:e=>e&&(new Date).toDateString()===new Date(e).toDateString(),parseTimestamp:xr,todayZero:()=>xr({}),format:wr,countdown:(e,t="")=>{const r="string"==typeof e||"number"==typeof e?new Date(e):e;if(!r)return"";return vr(r).toCountdown(t)},dtime:vr,loopFrame:(e=500)=>new yr(e),getTimezoneOffset:()=>br.timezoneOffset,getLocalTime:br.getLocalTime};const _r=e=>D.toBase64(e);var Sr={encode:_r,decode:e=>D.fromBase64(e),encodeByOss:e=>_r(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")};var Or={...hr,base64:Sr,tea:Ze,uuid:pr,guid:(e,t=!1,r="")=>{const n=pr(e||32);return t?Ar.now().format("yyyyMMddhhmmss")+r+n:n},getHexString:e=>{const t=hr.keyChars;let r="";const n=t.length;for(let o=0;o<e;o++)r+=t.charAt(Math.floor(Math.random()*n));return r}};const jr={...ie,...Or,...Wt,...Ut,...H,...ke,qs:cr};class Cr{key;storage;fields=[];constructor(e){this.key=e?.key||"",this.fields=e?.fields||[],this.storage=e?.storage||void 0}save=Wt.debounce((e=>{if(this.key&&this.storage)try{const{setItem:t,setStorageSync:r}=this.storage;if(r)return r(this.key,e);if(t)return t(this.key,JSON.stringify(e))}catch(e){console.error("persit save ",e)}}));read(){if(this.key&&this.storage)try{const{getItem:e,getStorageSync:t}=this.storage;if(t)return t(this.key);if(e){const t=e(this.key);return JSON.parse(t)}}catch(e){return void console.error("persit read ",e)}}handleSave(e,t){if(!this.fields.includes(t)||!e)return;const r=er.copy(e,{fields:this.fields});this.save(r)}}class kr extends gr{setters={};getters={};actions={};persist;constructor(){super()}async dispatch(e,t=void 0){const r=this,n=Reflect.get(r.actions,e);if(!I.isFunction(n))return;const[,o]=await Wt.run(n({...r,commit:r.commit.bind(r),query:r.query.bind(r),dispatch:r.dispatch.bind(r)},t));return o}async query(e){const t=Reflect.get(this,e);let r;if(null!=t&&""!==t)r=er.copy(t);else{const[,t]=await Wt.exec((()=>this.dispatch(e)),`${this.__eventId}_${e}`);r=t}return r}commit(e,t){I.isObject(t)&&(t=er.copy(t)),this[e]=t}}const $r={Store:kr,storeRef:(e,t)=>{const r=Object.assign(new kr,e||{});r.__persist=new Cr(t||r.persist);const n=r.__persist.read(),o=n?Object.assign(r,n):r;return new Proxy(o,{get:(e,t,r)=>{const n=Reflect.get(e.getters,t);return I.isFunction(n)?n(e):Reflect.get(e,t,r)},set:(e,t,r,n)=>{const o=Reflect.get(e.setters,t);if(I.isFunction(o)&&!o(e,r))return!0;const s=Reflect.set(e,t,r,n);return s&&(e.emit(t.toString(),r),e?.__persist?.handleSave(e,t.toString())),s},has:(e,t)=>Reflect.has(e,t)})},Persist:Cr,persistConfig:(e,t,r)=>({key:e,fields:t,storage:r})};var Er={gbkLength:function(e){let t=0;if(!e)return 0;for(let r=0;r<e.length;r++)e.charCodeAt(r)>127||94===e.charCodeAt(r)?t+=2:t++;return t},gbkCut:function(e,t){if(!e||t<=0)return"";let r=0,n=0;for(let o=0;o<e.length&&(e.charCodeAt(o)>127||94===e.charCodeAt(o)?r+=2:r++,!(r>t));o++)n=o;return e.substr(0,n+1)}};var Br={groupBy:function(e,t){return e.reduce(((e,r)=>((e[r[t]]=e[r[t]]||[]).push(r),e)),{})},first:function(e){if(!e)return;return e.length<=0?void 0:e[0]},last:function(e){if(!e)return;const t=e.length;return t<=0?void 0:e[t-1]},toList:function(e){return Array.isArray(e)?e:e?[e]:[]}};var qr={...Br,stepAction:function(e,t,r=100){if(!I.isFunction(t))return;if(!I.isArray(e)||e.length<=0)return;let n=0;for(;e.length>n;){let o=r+n,s=e.slice(n,o);t&&t(s),n=o}},skip:function(e,t){if(!I.isArray(e)||e.length<=0)return[];const r=t;return e.slice(r)},take:function(e,t,r=0){if(!I.isArray(e)||e.length<=0)return[];const n=r||0;if(n>=e.length)return[];const o=t+n;return e.slice(n,e.length<o?e.length:o)||[]},distinct:function(e){return!I.isArray(e)||e.length<=0?[]:[...new Set(e)]},randoms:function(e,t=1,r=!1){const n=e.length||0;return H.randoms(n,t,r).map((t=>e[t]))||[]},toKV:(e,t,r)=>{const n={};return t&&r?((e||[]).forEach((e=>{if(!e||!I.isObject(e))return;const o=e[t];(I.isString(o)&&""!==o||I.isNumber(o))&&(n[o]=e[r])})),n):n}};var Tr={pattern:{num:"0-9",zh:"一-龥",en:"A-Za-z"},regex:(e,t)=>new RegExp(e,t),entire:{chinese:/^[\u4E00-\u9FA5]+$/,real:/^(\-|\+)?\d+(\.\d+)?$/,cssReal:/^(\-|\+)?\d*(\.)?\d+$/,id:/^[A-Za-z0-9]+$/,yyyyMMdd:/^(\d{4})-?(\d{2})-?(\d{2})$/}};const Fr=/%[sdj%]/g;let Pr=()=>{};function Lr(e){if(!e||!e.length)return null;const t={};return e.forEach((e=>{const r=e.field;t[r]=t[r]||[],t[r].push(e)})),t}function Mr(e,...t){let r=0;const n=t.length;if("function"==typeof e)return e.apply(null,t);if("string"==typeof e){return e.replace(Fr,(e=>{if("%%"===e)return"%";if(r>=n)return e;switch(e){case"%s":return String(t[r++]);case"%d":return Number(t[r++]);case"%j":try{return JSON.stringify(t[r++])}catch(e){return"[Circular]"}break;default:return e}}))}return e}function Rr(e,t){return null==e||(!("array"!==t||!Array.isArray(e)||e.length)||!(!function(e){return"string"===e||"url"===e||"hex"===e||"email"===e||"date"===e||"pattern"===e}(t)||"string"!=typeof e||e))}function Ur(e,t,r){let n=0;const o=e.length;!function s(i){if(i&&i.length)return void r(i);const a=n;n+=1,a<o?t(e[a],s):r([])}([])}"undefined"!=typeof process&&process.env&&"production"!==process.env.NODE_ENV&&"undefined"!=typeof window&&"undefined"!=typeof document&&(Pr=(e,t)=>{"undefined"!=typeof console&&console.warn&&"undefined"==typeof ASYNC_VALIDATOR_NO_WARNING&&t.every((e=>"string"==typeof e))&&console.warn(e,t)});class Ir extends Error{errors;fields;constructor(e,t){super("Async Validation Error"),this.errors=e,this.fields=t}}function zr(e,t,r,n,o){if(t.first){const t=new Promise(((t,s)=>{const i=function(e){const t=[];return Object.keys(e).forEach((r=>{t.push(...e[r]||[])})),t}(e);Ur(i,r,(e=>(n(e),e.length?s(new Ir(e,Lr(e))):t(o))))}));return t.catch((e=>e)),t}const s=!0===t.firstFields?Object.keys(e):t.firstFields||[],i=Object.keys(e),a=i.length;let u=0;const c=[],l=new Promise(((t,l)=>{const f=e=>{if(c.push.apply(c,e),u++,u===a)return n(c),c.length?l(new Ir(c,Lr(c))):t(o)};i.length||(n(c),t(o)),i.forEach((t=>{const n=e[t];-1!==s.indexOf(t)?Ur(n,r,f):function(e,t,r){const n=[];let o=0;const s=e.length;function i(e){n.push(...e||[]),o++,o===s&&r(n)}e.forEach((e=>{t(e,i)}))}(n,r,f)}))}));return l.catch((e=>e)),l}function Dr(e,t){return r=>{let n;return n=e.fullFields?function(e,t){let r=e;for(let e=0;e<t.length;e++){if(null==r)return r;r=r[t[e]]}return r}(t,e.fullFields):t[r.field||e.fullField],function(e){return!(!e||void 0===e.message)}(r)?(r.field=r.field||e.fullField,r.fieldValue=n,r):{message:"function"==typeof r?r():r,fieldValue:n,field:r.field||e.fullField}}}function Nr(e,t){if(t)for(const r in t)if(t.hasOwnProperty(r)){const n=t[r];"object"==typeof n&&"object"==typeof e[r]?e[r]={...e[r],...n}:e[r]=n}return e}const Kr=(e,t,r,n,o,s)=>{!e.required||r.hasOwnProperty(e.field||"")&&!Rr(t,s||e.type)||n.push(Mr(o.messages.required,e.fullField))};let Vr;const Hr=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,Zr=/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i,Wr={integer:e=>Wr.number(e)&&parseInt(e,10)===e,float:e=>Wr.number(e)&&!Wr.integer(e),array:e=>Array.isArray(e),regexp(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch(e){return!1}},date:e=>"function"==typeof e.getTime&&"function"==typeof e.getMonth&&"function"==typeof e.getYear&&!isNaN(e.getTime()),number:e=>!isNaN(e)&&"number"==typeof e,object:e=>"object"==typeof e&&!Wr.array(e),method:e=>"function"==typeof e,email:e=>"string"==typeof e&&e.length<=320&&!!e.match(Hr),url:e=>"string"==typeof e&&e.length<=2048&&!!e.match((()=>{if(Vr)return Vr;const e="[a-fA-F\\d:]",t=t=>t&&t.includeBoundaries?`(?:(?<=\\s|^)(?=${e})|(?<=${e})(?=\\s|$))`:"",r="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",n="[a-fA-F\\d]{1,4}",o=`\n(?:\n(?:${n}:){7}(?:${n}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8\n(?:${n}:){6}(?:${r}|:${n}|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4\n(?:${n}:){5}(?::${r}|(?::${n}){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4\n(?:${n}:){4}(?:(?::${n}){0,1}:${r}|(?::${n}){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4\n(?:${n}:){3}(?:(?::${n}){0,2}:${r}|(?::${n}){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4\n(?:${n}:){2}(?:(?::${n}){0,3}:${r}|(?::${n}){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4\n(?:${n}:){1}(?:(?::${n}){0,4}:${r}|(?::${n}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4\n(?::(?:(?::${n}){0,5}:${r}|(?::${n}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4\n)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1\n`.replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),s=new RegExp(`(?:^${r}$)|(?:^${o}$)`),i=new RegExp(`^${r}$`),a=new RegExp(`^${o}$`),u=e=>e&&e.exact?s:new RegExp(`(?:${t(e)}${r}${t(e)})|(?:${t(e)}${o}${t(e)})`,"g");u.v4=e=>e&&e.exact?i:new RegExp(`${t(e)}${r}${t(e)}`,"g"),u.v6=e=>e&&e.exact?a:new RegExp(`${t(e)}${o}${t(e)}`,"g");const c=u.v4().source,l=u.v6().source;return Vr=new RegExp(`(?:^(?:(?:(?:[a-z]+:)?//)|www\\.)(?:\\S+(?::\\S*)?@)?(?:localhost|${c}|${l}|(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:[/?#][^\\s"]*)?$)`,"i"),Vr})()),hex:e=>"string"==typeof e&&!!e.match(Zr)},Qr="enum";var Yr={required:Kr,whitespace:(e,t,r,n,o)=>{(/^\s+$/.test(t)||""===t)&&n.push(Mr(o.messages.whitespace,e.fullField))},type:(e,t,r,n,o)=>{if(e.required&&void 0===t)return void Kr(e,t,r,n,o);const s=e.type;["integer","float","array","regexp","object","method","email","number","date","url","hex"].indexOf(s)>-1?Wr[s](t)||n.push(Mr(o.messages.types[s],e.fullField,e.type)):s&&typeof t!==e.type&&n.push(Mr(o.messages.types[s],e.fullField,e.type))},range:(e,t,r,n,o)=>{const s="number"==typeof e.len,i="number"==typeof e.min,a="number"==typeof e.max,u=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;let c=t,l="";const f="number"==typeof t,d="string"==typeof t,h=Array.isArray(t);if(f?l="number":d?l="string":h&&(l="array"),!l)return!1;h&&(c=t.length),d&&(c=t.replace(u,"_").length),s?c!==e.len&&n.push(Mr(o.messages[l].len,e.fullField,e.len)):i&&!a&&c<e.min?n.push(Mr(o.messages[l].min,e.fullField,e.min)):a&&!i&&c>e.max?n.push(Mr(o.messages[l].max,e.fullField,e.max)):i&&a&&(c<e.min||c>e.max)&&n.push(Mr(o.messages[l].range,e.fullField,e.min,e.max))},enum:(e,t,r,n,o)=>{e[Qr]=Array.isArray(e[Qr])?e[Qr]:[],-1===e[Qr].indexOf(t)&&n.push(Mr(o.messages[Qr],e.fullField,e[Qr].join(", ")))},pattern:(e,t,r,n,o)=>{if(e.pattern)if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(t)||n.push(Mr(o.messages.pattern.mismatch,e.fullField,t,e.pattern));else if("string"==typeof e.pattern){new RegExp(e.pattern).test(t)||n.push(Mr(o.messages.pattern.mismatch,e.fullField,t,e.pattern))}}};const Jr=(e,t,r,n,o)=>{const s=e.type,i=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Rr(t,s)&&!e.required)return r();Yr.required(e,t,n,i,o,s),Rr(t,s)||Yr.type(e,t,n,i,o)}r(i)};var Gr={string:(e,t,r,n,o)=>{const s=[];if(e.required||!e.required&&n.hasOwnProperty(e.field||"")){if(Rr(t,"string")&&!e.required)return r();Yr.required(e,t,n,s,o,"string"),Rr(t,"string")||(Yr.type(e,t,n,s,o),Yr.range(e,t,n,s,o),Yr.pattern(e,t,n,s,o),!0===e.whitespace&&Yr.whitespace(e,t,n,s,o))}r(s)},method:(e,t,r,n,o)=>{const s=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Rr(t)&&!e.required)return r();Yr.required(e,t,n,s,o),void 0!==t&&Yr.type(e,t,n,s,o)}r(s)},number:(e,t,r,n,o)=>{const s=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(""===t&&(t=void 0),Rr(t)&&!e.required)return r();Yr.required(e,t,n,s,o),void 0!==t&&(Yr.type(e,t,n,s,o),Yr.range(e,t,n,s,o))}r(s)},boolean:(e,t,r,n,o)=>{const s=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Rr(t)&&!e.required)return r();Yr.required(e,t,n,s,o),void 0!==t&&Yr.type(e,t,n,s,o)}r(s)},regexp:(e,t,r,n,o)=>{const s=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Rr(t)&&!e.required)return r();Yr.required(e,t,n,s,o),Rr(t)||Yr.type(e,t,n,s,o)}r(s)},integer:(e,t,r,n,o)=>{const s=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Rr(t)&&!e.required)return r();Yr.required(e,t,n,s,o),void 0!==t&&(Yr.type(e,t,n,s,o),Yr.range(e,t,n,s,o))}r(s)},float:(e,t,r,n,o)=>{const s=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Rr(t)&&!e.required)return r();Yr.required(e,t,n,s,o),void 0!==t&&(Yr.type(e,t,n,s,o),Yr.range(e,t,n,s,o))}r(s)},array:(e,t,r,n,o)=>{const s=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(null==t&&!e.required)return r();Yr.required(e,t,n,s,o,"array"),null!=t&&(Yr.type(e,t,n,s,o),Yr.range(e,t,n,s,o))}r(s)},object:(e,t,r,n,o)=>{const s=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Rr(t)&&!e.required)return r();Yr.required(e,t,n,s,o),void 0!==t&&Yr.type(e,t,n,s,o)}r(s)},enum:(e,t,r,n,o)=>{const s=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Rr(t)&&!e.required)return r();Yr.required(e,t,n,s,o),void 0!==t&&Yr.enum(e,t,n,s,o)}r(s)},pattern:(e,t,r,n,o)=>{const s=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Rr(t,"string")&&!e.required)return r();Yr.required(e,t,n,s,o),Rr(t,"string")||Yr.pattern(e,t,n,s,o)}r(s)},date:(e,t,r,n,o)=>{const s=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Rr(t,"date")&&!e.required)return r();if(Yr.required(e,t,n,s,o),!Rr(t,"date")){let r;r=t instanceof Date?t:new Date(t),Yr.type(e,r,n,s,o),r&&Yr.range(e,r.getTime(),n,s,o)}}r(s)},url:Jr,hex:Jr,email:Jr,required:(e,t,r,n,o)=>{const s=[],i=Array.isArray(t)?"array":typeof t;Yr.required(e,t,n,s,o,i),r(s)},any:(e,t,r,n,o)=>{const s=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Rr(t)&&!e.required)return r();Yr.required(e,t,n,s,o)}r(s)}};function Xr(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone(){const e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}const en=Xr();class tn{static register=function(e,t){if("function"!=typeof t)throw new Error("Cannot register a validator by type, validator is not a function");Gr[e]=t};static warning=Pr;static messages=en;static validators=Gr;rules={};_messages=en;constructor(e){this.define(e)}define(e){if(!e)throw new Error("Cannot configure a schema with no rules");if("object"!=typeof e||Array.isArray(e))throw new Error("Rules must be an object");this.rules={},Object.keys(e).forEach((t=>{const r=e[t];this.rules[t]=Array.isArray(r)?r:[r]}))}messages(e){return e&&(this._messages=Nr(Xr(),e)),this._messages}validate(e,t={},r=(()=>{})){let n=e,o=t,s=r;if("function"==typeof o&&(s=o,o={}),!this.rules||0===Object.keys(this.rules).length)return s&&s(null,n),Promise.resolve(n);if(o.messages){let e=this.messages();e===en&&(e=Xr()),Nr(e,o.messages),o.messages=e}else o.messages=this.messages();const i={};(o.keys||Object.keys(this.rules)).forEach((t=>{const r=this.rules[t];let o=n[t];r.forEach((r=>{let s=r;"function"==typeof s.transform&&(n===e&&(n={...n}),o=n[t]=s.transform(o)),s="function"==typeof s?{validator:s}:{...s},s.validator=this.getValidationMethod(s),s.validator&&(s.field=t,s.fullField=s.fullField||t,s.type=this.getType(s),i[t]=i[t]||[],i[t].push({rule:s,value:o,source:n,field:t}))}))}));const a={};return zr(i,o,((e,t)=>{const r=e.rule;let s,i=!("object"!==r.type&&"array"!==r.type||"object"!=typeof r.fields&&"object"!=typeof r.defaultField);function u(e,t){return{...t,fullField:`${r.fullField}.${e}`,fullFields:r.fullFields?[...r.fullFields,e]:[e]}}function c(s=[]){let c=Array.isArray(s)?s:[s];!0===o.suppressWarning&&c.length&&tn.warning("async-validator:",c),c.length&&void 0!==r.message&&(c=[].concat(r.message));let l=c.map(Dr(r,n));if(o.first&&l.length)return a[r.field]=1,t(l);if(i){if(r.required&&!e.value)return void 0!==r.message?l=[].concat(r.message).map(Dr(r,n)):o.error&&(l=[o.error(r,Mr(o.messages.required,r.field))]),t(l);let s={};r.defaultField&&Object.keys(e.value).map((e=>{s[e]=r.defaultField})),s={...s,...e.rule.fields};const i={};Object.keys(s).forEach((e=>{const t=s[e],r=Array.isArray(t)?t:[t];i[e]=r.map(u.bind(null,e))}));const a=new tn(i);a.messages(o.messages),e.rule.options&&(e.rule.options.messages=o.messages,e.rule.options.error=o.error),a.validate(e.value,e.rule.options||o,(e=>{const r=[];l&&l.length&&r.push(...l),e&&e.length&&r.push(...e),t(r.length?r:null)}))}else t(l)}if(i=i&&(r.required||!r.required&&e.value),r.field=e.field,r.asyncValidator)s=r.asyncValidator(r,e.value,c,e.source,o);else if(r.validator){try{s=r.validator(r,e.value,c,e.source,o)}catch(e){console.error?.(e),o.suppressValidatorError||setTimeout((()=>{throw e}),0),c(e.message)}!0===s?c():!1===s?c("function"==typeof r.message?r.message(r.fullField||r.field):r.message||`${r.fullField||r.field} fails`):s instanceof Array?c(s):s instanceof Error&&c(s.message)}s&&s.then&&s.then((()=>c()),(e=>c(e)))}),(e=>{!function(e){let t=[],r={};for(let r=0;r<e.length;r++)o=e[r],Array.isArray(o)?t=t.concat(...o):t.push(o);var o;t.length?(r=Lr(t),s(t,r)):s(null,n)}(e)}),n)}getType(e){if(void 0===e.type&&e.pattern instanceof RegExp&&(e.type="pattern"),"function"!=typeof e.validator&&e.type&&!Gr.hasOwnProperty(e.type))throw new Error(Mr("Unknown rule type %s",e.type));return e.type||"string"}getValidationMethod(e){if("function"==typeof e.validator)return e.validator;const t=Object.keys(e),r=t.indexOf("message");return-1!==r&&t.splice(r,1),1===t.length&&"required"===t[0]?Gr.required:Gr[this.getType(e)]||void 0}}function rn(e){return new tn(e)}var nn={validateId:function(e){return!!e&&(!(e.length<6)&&!!/^[A-Za-z0-9_-]+$/.test(e))},validatePhone:function(e){return!!e&&!!/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(e)},validator:rn,validate:function(e,t,r={},n=(()=>{})){return Wt.run(rn(e).validate(t,r,n))},isChinese:function(e){return!!e&&!!/^[\u4E00-\u9FA5]+$/.test(e)},isNumber:function(e){return!!e&&!!/^[0-9]+$/.test(e)},isFloat:function(e){return!!e&&!!/^(\-|\+)?\d+(\.\d+)?$/.test(e)},isPhoneNumber:function(e){return!!e&&!!/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(e)}};function on(e){return e!=e}function sn(e,t){return function(e,t){for(var r=-1,n=e?e.length:0,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o}(t,(function(t){return e[t]}))}var an,un,cn=(an=Object.keys,un=Object,function(e){return an(un(e))}),ln=Math.max;function fn(e,t){var r=I.isArray(e)||I.isArguments(e)?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],n=r.length,o=!!n;for(var s in e)!t&&!g.hasOwnProperty.call(e,s)||o&&("length"==s||I.isIndex(s,n))||r.push(s);return r}var dn={...I,...g,...er,...ke,includes:function(e,t,r,n){e=I.isArrayLike(e)?e:function(e){return e?sn(e,function(e){return I.isArrayLike(e)?fn(e):function(e){if(!I.isPrototype(e))return cn(e);var t=[];for(var r in Object(e))g.hasOwnProperty.call(e,r)&&"constructor"!=r&&t.push(r);return t}(e)}(e)):[]}(e),r=r&&!n?me.toInteger(r):0;var o=e.length;return r<0&&(r=ln(o+r,0)),I.isString(e)?r<=o&&e.indexOf(t,r)>-1:!!o&&function(e,t,r){if(t!=t)return function(e,t,r,n){for(var o=e.length,s=r+(n?1:-1);n?s--:++s<o;)if(t(e[s],s,e))return s;return-1}(e,on,r);for(var n=r-1,o=e.length;++n<o;)if(e[n]===t)return n;return-1}(e,t,r)>-1},forof:(e,t)=>{if(!e)return;let r;if(I.isObject(e)&&(r=I.isArray(e)?e.entries():Object.entries(e),r))for(const[e,n]of r)t&&t(e,n)}};const hn={gbk:Er,math:H,list:qr,string:Ut,time:Ar,obj:er,rule:nn,regex:Tr,...ie,...Or,...dn,Event:Event};const pn=new class{__defStyle="vertical-align: middle; mask-position: 50% 50%; mask-repeat: no-repeat; mask-size: 100%; -webkit-mask-position: 50% 50%; -webkit-mask-repeat: no-repeat; -webkit-mask-size: 100%; background-color: currentColor;";__map={back:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M609.408 149.376L277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z"/></svg>',right:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"/></svg>',home:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M13 19.8h3.8v-7h3.303L12 4.697 3.897 12.8H7.2v7H11V17h2v2.8zm5 .2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1v-6H3.414a1 1 0 0 1-.707-1.707l8.586-8.586a1 1 0 0 1 1.414 0l8.586 8.586A1 1 0 0 1 20.586 14H18v6z" fill-rule="evenodd" fill-opacity=".9"/></svg>',close:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M764.288 214.592L512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"/></svg>',close_circle:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M466.752 512l-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248L466.752 512z"/><path fill="currentColor" d="M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z"/></svg>',close_circle_fill:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896zm0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336L512 457.664z"/></svg>',warning:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M928.99 755.83L574.6 203.25c-12.89-20.16-36.76-32.58-62.6-32.58s-49.71 12.43-62.6 32.58L95.01 755.83c-12.91 20.12-12.9 44.91.01 65.03 12.92 20.12 36.78 32.51 62.59 32.49h708.78c25.82.01 49.68-12.37 62.59-32.49 12.91-20.12 12.92-44.91.01-65.03zM554.67 768h-85.33v-85.33h85.33V768zm0-426.67v298.66h-85.33V341.32l85.33.01z" fill="currentColor"/></svg>',play:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M512 1024A512 512 0 1 1 512 0a512 512 0 0 1 0 1024zm3.008-92.992a416 416 0 1 0 0-832 416 416 0 0 0 0 832zM383.232 287.616l384 224.896-384 223.104v-448z" fill="currentColor"/></svg>',lock:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32H224zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96z"/><path fill="currentColor" d="M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32zm192-160v-64a192 192 0 1 0-384 0v64h384zM512 64a256 256 0 0 1 256 256v128H256V320A256 256 0 0 1 512 64z"/></svg>',lock_fill:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M467.2 713.92v115.968a44.8 44.8 0 0 0 89.6 0V713.92c26.752-14.72 44.8-42.304 44.8-73.92 0-47.104-40.128-85.312-89.6-85.312-49.472 0-89.6 38.208-89.6 85.312 0 31.616 18.048 59.136 44.8 73.92zM64 384h896v640H64V384zm268.8 0h358.4V256c0-94.272-80.256-170.688-179.2-170.688-98.944 0-179.2 76.416-179.2 170.688v128zM512 0c148.48 0 268.8 114.56 268.8 256v128H243.2V256C243.2 114.56 363.52 0 512 0z" fill="currentColor"/></svg>',plus:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64h352z"/></svg>',plus_circle:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M352 480h320a32 32 0 1 1 0 64H352a32 32 0 0 1 0-64z"/><path fill="currentColor" d="M480 672V352a32 32 0 1 1 64 0v320a32 32 0 0 1-64 0z"/><path fill="currentColor" d="M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z"/></svg>',plus_circle_fill:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896zm-38.4 409.6H326.4a38.4 38.4 0 1 0 0 76.8h147.2v147.2a38.4 38.4 0 0 0 76.8 0V550.4h147.2a38.4 38.4 0 0 0 0-76.8H550.4V326.4a38.4 38.4 0 1 0-76.8 0v147.2z"/></svg>',star:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M512 747.84l228.16 119.936a6.4 6.4 0 0 0 9.28-6.72l-43.52-254.08 184.512-179.904a6.4 6.4 0 0 0-3.52-10.88l-255.104-37.12L517.76 147.904a6.4 6.4 0 0 0-11.52 0L392.192 379.072l-255.104 37.12a6.4 6.4 0 0 0-3.52 10.88L318.08 606.976l-43.584 254.08a6.4 6.4 0 0 0 9.28 6.72L512 747.84zM313.6 924.48a70.4 70.4 0 0 1-102.144-74.24l37.888-220.928L88.96 472.96A70.4 70.4 0 0 1 128 352.896l221.76-32.256 99.2-200.96a70.4 70.4 0 0 1 126.208 0l99.2 200.96 221.824 32.256a70.4 70.4 0 0 1 39.04 120.064L774.72 629.376l37.888 220.928a70.4 70.4 0 0 1-102.144 74.24L512 820.096l-198.4 104.32z"/></svg>',star_fill:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M283.84 867.84L512 747.776l228.16 119.936a6.4 6.4 0 0 0 9.28-6.72l-43.52-254.08 184.512-179.904a6.4 6.4 0 0 0-3.52-10.88l-255.104-37.12L517.76 147.904a6.4 6.4 0 0 0-11.52 0L392.192 379.072l-255.104 37.12a6.4 6.4 0 0 0-3.52 10.88L318.08 606.976l-43.584 254.08a6.4 6.4 0 0 0 9.28 6.72z"/></svg>',share:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M679.872 348.8l-301.76 188.608a127.808 127.808 0 0 1 5.12 52.16l279.936 104.96a128 128 0 1 1-22.464 59.904l-279.872-104.96a128 128 0 1 1-16.64-166.272l301.696-188.608a128 128 0 1 1 33.92 54.272z"/></svg>',love:'<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M171.712 571.648l.352.32 287.904 252.8a64 64 0 0 0 82.912 1.344l296.832-244.544a215.584 215.584 0 1 0-301.824-300.576L512 316.672l-25.888-35.616a215.584 215.584 0 1 0-314.4 290.624zM32 407.584A279.584 279.584 0 0 1 512 212.64a279.584 279.584 0 0 1 480 194.944 278.144 278.144 0 0 1-113.024 224.512l-295.36 243.392a128 128 0 0 1-165.888-2.592L129.984 620.16A278.976 278.976 0 0 1 32 407.584z"/></svg>',love_fill:'<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M32 407.584A279.584 279.584 0 0 1 512 212.64a279.584 279.584 0 0 1 480 194.944 278.144 278.144 0 0 1-113.024 224.512L562.592 892.8a96 96 0 0 1-124.416-1.952L130.016 620.16A278.976 278.976 0 0 1 32 407.584z"/></svg>'};getBase64=e=>{const t=this.getSVG(e);return t?.url||""};getSVG=e=>{if(!e)return;const t=this.__map[e];if(!t)return;return{url:this.toBase64(t),escape:this.toEscape(t)}};toBase64=e=>{if(!e)return"";const t=this._tiny(e);return`data:image/svg+xml;base64,${Sr.encode(t)}`};_tiny=e=>e?e.replace(/<!--(.*)-->/g,"").replace(/[\r\n]/g," ").replace(/"/g,"'"):"";toEscape=e=>{if(!e)return"";return`data:image/svg+xml,${this._tiny(e).replace(/%/g,"%25").replace(/&/g,"%26").replace(/#/g,"%23").replace(/{/g,"%7B").replace(/}/g,"%7D").replace(/</g,"%3C").replace(/>/g,"%3E")}`};getStyle(e,t={}){if(!e)return"";const r=this.__map[e];return r?this.toStyle(r,t):""}toStyle(e,t={}){if(!e)return"";const r=this.toBase64(e);return r?this.getStyleByUrl(r,t):""}getStyleByUrl(e,t={}){if(!e)return"";const{key:r="mask-image",gradientValue:n="radial-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5))",gradient:o=!1,defStyle:s=this.__defStyle}=t,i=o&&n?`${n}, url("${e}")`:`url("${e}")`;return`${r}:${i};-webkit-${r}:${i};${s}`}},gn=e=>{if(!e)return"";if(!dn.isObject(e))return"";let t="";return dn.forof(e,((e,r)=>{r&&(t+=`${Ut.kebabCase(e)}:${r};`)})),t},yn=["display","position","top","bottom","left","right","padding","margin","marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft","height","width","fontSize","textAlign","fontFamily","border","borderLeft","borderRight","borderTop","borderBottom","borderColor","borderRadius","background","backgroundImage","backgroundRepeat","backgroundSize","backgroundPosition","color","overflow","opacity","flexDirection","justifyContent","alignItems","flexWrap","alignContent","alignSelf","flex","flexBasis","flexFlow","flexShrink","pointerEvents"],mn=["top","bottom","left","right","padding","margin","marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft","height","width","border","borderLeft","borderRight","borderTop","borderBottom","borderColor","borderRadius"],bn=(e,t="px")=>e&&t?"0"===e?e:nn.isFloat(e.toString())?`${e}${t}`:e:e;var wn={stringify:gn,parse:(e,{camel:t=!1,pure:r=!0}={})=>{if(!e.trim())return;const n=cr.parse(e,{sep:";",eq:":",uri:!1}),o={};return dn.forof(n,((e,n)=>{if(!n)return;const s=t?r&&e.startsWith("_")?e:Ut.camelCase(e):e;nn.isFloat(n)||n.length>=2&&n.startsWith(".")&&nn.isNumber(n.substr(1))?o[s]=+n:o[s]=n})),o},fixValue:bn,style:(e,t="px")=>{if(!e)return"";const r=dn.copy(e,{fields:yn});dn.forof(r,((e,n)=>{(mn.includes(e)||mn.includes(Ut.camelCase(e)))&&(r[e]=bn(n,t))}));return gn(r)},commonFields:yn};var vn={getDataURL:(e,t)=>{const r={contentType:"",dataUrl:""};return je.to(fetch(e,{cache:t}).then((e=>(r.contentType=e.headers.get("content-type")||"",e.arrayBuffer()))).then((e=>(r.dataUrl=`data:${r.contentType};base64,`+ie.ab2str(e,!0),r))))},getArrayBuffer:async(e,t)=>je.to(fetch(e,{cache:t}).then((e=>e.arrayBuffer()))),getJson:async(e,t)=>je.to(fetch(e,{cache:t}).then((e=>e.json()))),download:(e,t={})=>new Promise((r=>fetch(e).then((async e=>{if(!e.ok||200!==e.status)throw new Error(e.statusText);const n=+(e.headers.get("content-length")||""),o=e.body?.getReader();let s=0;const i=[];for(;;){const{done:e,value:r}=await o.read();if(e)break;i.push(r),s+=r.length;const a=H.float(100*s/n,{digits:2});t?.progress&&t?.progress(a,s,n)}const a=new Uint8Array(s);let u=0;for(const e of i)a.set(e,u),u+=e.length;t?.success&&t?.success(a),r(a)})).catch((e=>{t?.fail&&t?.fail(e),r(void 0)})))),getText:async(e,t)=>je.to(fetch(e,{cache:t}).then((e=>e.text()))),cache:async(e,t="no-cache")=>je.to(fetch(e,{cache:t}).then((()=>!0)))};const xn=(e,t="",r=!1)=>{try{if(!e)return;const n=cr.parseUrl(e),o=t||n.name;if(!t||!r||!n.origin||n.origin===window.location.origin)((e,t)=>{try{const r=document.createElement("a");r.style.display="none",r.href=e,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r)}catch(t){console.error(`[ddan] _downloadUrl ${e}`,t)}})(e,o);else{const t=n.params;t.t=Date.now();const r=`${n.url}?${cr.stringify(t,{uri:!1})}`,s=new XMLHttpRequest;s.open("GET",r,!0),s.responseType="blob",s.onload=function(){An(s.response,o)},s.onerror=function(t){console.error(`[ddan] downloadUrl ${e}`,t)},s.send()}}catch(t){console.error(`[ddan] downloadUrl ${e}`,t)}},An=(e,t="")=>{try{if(!e)return;const r=URL?.createObjectURL(e);if(!r)return;xn(r,t),URL?.revokeObjectURL(r)}catch(e){console.error("[ddan] downloadFile",e)}},_n=e=>{try{const t=document.createElement("textarea");document.body.appendChild(t),t.style.position="fixed",t.style.clip="rect(0 0 0 0)",t.style.top="10px",t.style.opacity="0",t.value=e??"",t.select();const r=document.execCommand("copy");return document.body.removeChild(t),r}catch(e){return console.error("[ddan] copyText",e),!1}},Sn=(e,t="denied")=>new Promise((r=>{const n=navigator?.permissions;if(!n||!n.query)return r(t);const o={name:e};n.query(o).then((e=>r(e.state))).catch((()=>r(t)))})),On=(e,t=!0)=>!(!t||"prompt"!==e)||"granted"===e,jn=(e,t)=>{if(!e||!t)return[];const r=[];let n;for(;null!==(n=t.exec(e));)r.push(n[1]);return r};var Cn={dataURLtoFile:(e,t)=>{let r=e.split(","),n=r[0].match(/:(.*?);/)[1],o=window.atob(r[1]),s=o.length,i=new Uint8Array(s);for(;s--;)i[s]=o.charCodeAt(s);return new File([i],t,{type:n})},dataURLtoBlob:e=>{let t=e.split(","),r=t[0].match(/:(.*?);/)[1],n=window.atob(t[1]),o=n.length,s=new Uint8Array(o);for(;o--;)s[o]=n.charCodeAt(o);return new Blob([s],{type:r})},blobToFile:(e,t)=>(e.lastModifiedDate=new Date,e.name=t,e),readAsDataURL:(e,t)=>{var r=new FileReader;r.readAsDataURL(e),r.onloadend=function(e){t&&t(e.target?.result)}},downloadUrl:xn,download:(e,t="")=>{e&&("string"!=typeof e?An(e,t):xn(e,t))},downloadFile:An,downloadImage:e=>{try{if(!e)return;const t=e.match(/\/(\w+.\w+)$/)[1],r=new Image;r.onload=()=>{let e=document.createElement("canvas");e.width=r.width,e.height=r.height;let n=e.getContext("2d");n&&n.drawImage(r,0,0,r.width,r.height);let o=e.toDataURL();xn(o,t)},r.src=e,r.setAttribute("crossOrigin","Anonymous")}catch(e){console.error("[ddan] downloadImage",e)}return Promise.resolve()},watermark:(e,{width:t=400,height:r=300,angle:n=0,fillStyle:o="rgba(0, 0, 0, 0.2)",font:s="16px Arial",textAlign:i="left",textBaseline:a="middle"}={})=>{try{if(!e)return"";const u=document.createElement("canvas");u.width=t,u.height=r;const c=u.getContext("2d");return c?(n&&c.rotate(n*Math.PI/180),o&&(c.fillStyle=o),s&&(c.font=s),i&&(c.textAlign=i),a&&(c.textBaseline=a),c.fillText(e,u.width/10,u.height/2),`url(${u.toDataURL()})`):""}catch(e){return console.error("[ddan] watermark",e),""}},copyText:(e,t=!1)=>new Promise((r=>{!t&&navigator.clipboard?Sn("clipboard-write").then((t=>{On(t,!1)?navigator.clipboard.writeText(e).then((()=>r(!0))).catch((()=>r(_n(e)))):r(_n(e))})).catch((()=>{r(_n(e))})):r(_n(e))})),queryPermission:Sn,isAllowed:On,legacyCopy:_n,takeHtmlLinks:e=>{if(!e)return[];const t=[];return[/<script[^>]+src="([^"]+)"/g,/<link[^>]+rel="stylesheet"[^>]+href="([^"]+)"/g,/<link[^>]+rel="icon"[^>]+href="([^"]+)"/g].forEach((r=>{const n=jn(e,r);t.push(n)})),[].concat(...t)},takeHtml:jn,toBlobUrl:(e,t)=>{const r=new Blob([e],{type:t});return URL.createObjectURL(r)}};class kn{list=[];constructor(){this.invoke=this.invoke.bind(this)}use(e){this.list=this.list.concat(e)}invoke(e){return this.list.reduce(((e,t)=>e.then((e=>t(e)))),Promise.resolve(e)).catch((e=>"REFETCH"===e.sig?Promise.resolve(e.result):Promise.reject(e)))}}const $n=({url:e,options:t})=>{const r={"Content-Type":"application/json; charset=utf-8",...t.headers||{}};return t.headers=r,new Promise(((r,n)=>{fetch(e,t).then((e=>{r(e.json())})).catch((e=>{n(e)}))}))};function En(e){const{response:t}=e;return 0===t.code?Promise.resolve(t):Promise.reject(t)}function Bn(e){const{url:t="",host:r,options:n}=e,o=e;if(t.startsWith("http://")||t.startsWith("https://")||(o.url=(r||"")+t),"GET"===n.method.toUpperCase()&&n.body){const e=JSON.parse(n.body);if(dn.isPlainObject(e)){const r=cr.stringify(e),n=-1===t.indexOf("?")?"?":"&";o.url=`${o.url||""}${n}${r}`,delete o.options.body}}return n&&n.plugins&&delete o.options?.plugins,n&&n.model&&delete o.options?.model,o}class qn{host="";reqConfig={};handleError;interceptors={request:new kn,response:new kn};constructor(e){this.host=e.host||"",this.reqConfig=e.config,this.interceptors.request.use(e.handleRequest||[]),this.interceptors.request.use(Bn),this.interceptors.response.use(e.handleResponse||En),this.handleError=e.handleError}static blockId="blockid";static requestLock={};lockR(e,t){qn.requestLock[e]={lock:!0,request:t()}}unlockR(e){delete qn.requestLock[e]}getIdFromReq(e){const{url:t,data:r={}}=e;return t+JSON.stringify(r)}getIdFromReqUrl(e){return e.url||""}async fetch(e,t){const r=dn.copy(this.reqConfig[e])||{},n={host:this.host,url:r.url||"",options:{...r||{},body:JSON.stringify({...t||{}})}};try{const o=await this.interceptors.request.invoke(n);let s;if(delete o.options.plugins,"block"===r.model)this.lockR(qn.blockId,(()=>$n(o))),s=await qn.requestLock[qn.blockId].request;else if(qn.requestLock[qn.blockId]&&qn.requestLock[qn.blockId].lock&&await qn.requestLock[qn.blockId].request,"debounce"===r.model||"debounceUrl"===r.model){let e;e="debounceUrl"===r.model?this.getIdFromReqUrl(o):this.getIdFromReq(o),qn.requestLock[e]||this.lockR(e,(()=>$n(o))),s=await qn.requestLock[e].request,this.unlockR(e)}else s=await $n(o);return this.interceptors.response.invoke({response:s,config:r,refetch:()=>({sig:"REFETCH",result:this.fetch(e,t)})})}catch(e){return this.handleError&&this.handleError(e),Promise.reject(e)}}}const Tn={fetch:vn,Http:qn,css:wn,qs:cr,icon:pn,html:Cn};e.dHook=jr,e.dStore=$r,e.dUtil=hn,e.dWeb=Tn,Object.defineProperty(e,"__esModule",{value:!0})}));
|
package/bin/lib/class/event.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t from"../modules/crypto/uuid.js";class s{__map;__tagList;__eventId="";constructor(){this.__map=new Map,this.__tagList=[],this.__eventId=t()}clear(){return this.__map.clear(),this}on(t,s,i=""){if(!t||!s)return this;let e=this.__map.get(t);return e||(e=new Set,this.__map.set(t,e)),e.add(s),i&&this.__tagList.push({name:t,listener:s,tag:i}),this}emit(t,...s){if(!t)return this;const i=this.__map.get(t);if(!i)return this;return[...i].forEach((t=>t&&t(...s))),this}off(t,s){if(!t||!s)return this;this.__tagList=this.__tagList.filter((i=>i.name!==t||i.listener!==s));const i=this.__map.get(t);return i?(i.delete(s),i.size<=0&&this.__map.delete(t),this):this}remove(t){return t?(this.__tagList=this.__tagList.filter((s=>s.name!==t)),this.__map.delete(t),this):this}removeByTag(t){if(!t)return this;return this.__tagList.filter((s=>s.tag===t)).forEach((t=>{this.off(t.name,t.listener)})),this.__tagList=this.__tagList.filter((s=>s.tag!==t)),this}once(t,s){const i=(...e)=>{s(...e),this.off(t,i)};return this.on(t,i),this}has(t){return this.__map.has(t)}}export{s as default};
|
package/bin/lib/class/getset.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
class e{__value=void 0;set(e){this.__value=e}get(){return this.__value}}export{e as default};
|
package/bin/lib/class/icon.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import l from"../modules/crypto/base64.js";class a{__defStyle="vertical-align: middle; mask-position: 50% 50%; mask-repeat: no-repeat; mask-size: 100%; -webkit-mask-position: 50% 50%; -webkit-mask-repeat: no-repeat; -webkit-mask-size: 100%; background-color: currentColor;";__map={back:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M609.408 149.376L277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z"/></svg>',right:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"/></svg>',home:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M13 19.8h3.8v-7h3.303L12 4.697 3.897 12.8H7.2v7H11V17h2v2.8zm5 .2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1v-6H3.414a1 1 0 0 1-.707-1.707l8.586-8.586a1 1 0 0 1 1.414 0l8.586 8.586A1 1 0 0 1 20.586 14H18v6z" fill-rule="evenodd" fill-opacity=".9"/></svg>',close:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M764.288 214.592L512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"/></svg>',close_circle:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M466.752 512l-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248L466.752 512z"/><path fill="currentColor" d="M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z"/></svg>',close_circle_fill:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896zm0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336L512 457.664z"/></svg>',warning:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M928.99 755.83L574.6 203.25c-12.89-20.16-36.76-32.58-62.6-32.58s-49.71 12.43-62.6 32.58L95.01 755.83c-12.91 20.12-12.9 44.91.01 65.03 12.92 20.12 36.78 32.51 62.59 32.49h708.78c25.82.01 49.68-12.37 62.59-32.49 12.91-20.12 12.92-44.91.01-65.03zM554.67 768h-85.33v-85.33h85.33V768zm0-426.67v298.66h-85.33V341.32l85.33.01z" fill="currentColor"/></svg>',play:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M512 1024A512 512 0 1 1 512 0a512 512 0 0 1 0 1024zm3.008-92.992a416 416 0 1 0 0-832 416 416 0 0 0 0 832zM383.232 287.616l384 224.896-384 223.104v-448z" fill="currentColor"/></svg>',lock:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32H224zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96z"/><path fill="currentColor" d="M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32zm192-160v-64a192 192 0 1 0-384 0v64h384zM512 64a256 256 0 0 1 256 256v128H256V320A256 256 0 0 1 512 64z"/></svg>',lock_fill:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M467.2 713.92v115.968a44.8 44.8 0 0 0 89.6 0V713.92c26.752-14.72 44.8-42.304 44.8-73.92 0-47.104-40.128-85.312-89.6-85.312-49.472 0-89.6 38.208-89.6 85.312 0 31.616 18.048 59.136 44.8 73.92zM64 384h896v640H64V384zm268.8 0h358.4V256c0-94.272-80.256-170.688-179.2-170.688-98.944 0-179.2 76.416-179.2 170.688v128zM512 0c148.48 0 268.8 114.56 268.8 256v128H243.2V256C243.2 114.56 363.52 0 512 0z" fill="currentColor"/></svg>',plus:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64h352z"/></svg>',plus_circle:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M352 480h320a32 32 0 1 1 0 64H352a32 32 0 0 1 0-64z"/><path fill="currentColor" d="M480 672V352a32 32 0 1 1 64 0v320a32 32 0 0 1-64 0z"/><path fill="currentColor" d="M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z"/></svg>',plus_circle_fill:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896zm-38.4 409.6H326.4a38.4 38.4 0 1 0 0 76.8h147.2v147.2a38.4 38.4 0 0 0 76.8 0V550.4h147.2a38.4 38.4 0 0 0 0-76.8H550.4V326.4a38.4 38.4 0 1 0-76.8 0v147.2z"/></svg>',star:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M512 747.84l228.16 119.936a6.4 6.4 0 0 0 9.28-6.72l-43.52-254.08 184.512-179.904a6.4 6.4 0 0 0-3.52-10.88l-255.104-37.12L517.76 147.904a6.4 6.4 0 0 0-11.52 0L392.192 379.072l-255.104 37.12a6.4 6.4 0 0 0-3.52 10.88L318.08 606.976l-43.584 254.08a6.4 6.4 0 0 0 9.28 6.72L512 747.84zM313.6 924.48a70.4 70.4 0 0 1-102.144-74.24l37.888-220.928L88.96 472.96A70.4 70.4 0 0 1 128 352.896l221.76-32.256 99.2-200.96a70.4 70.4 0 0 1 126.208 0l99.2 200.96 221.824 32.256a70.4 70.4 0 0 1 39.04 120.064L774.72 629.376l37.888 220.928a70.4 70.4 0 0 1-102.144 74.24L512 820.096l-198.4 104.32z"/></svg>',star_fill:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M283.84 867.84L512 747.776l228.16 119.936a6.4 6.4 0 0 0 9.28-6.72l-43.52-254.08 184.512-179.904a6.4 6.4 0 0 0-3.52-10.88l-255.104-37.12L517.76 147.904a6.4 6.4 0 0 0-11.52 0L392.192 379.072l-255.104 37.12a6.4 6.4 0 0 0-3.52 10.88L318.08 606.976l-43.584 254.08a6.4 6.4 0 0 0 9.28 6.72z"/></svg>',share:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M679.872 348.8l-301.76 188.608a127.808 127.808 0 0 1 5.12 52.16l279.936 104.96a128 128 0 1 1-22.464 59.904l-279.872-104.96a128 128 0 1 1-16.64-166.272l301.696-188.608a128 128 0 1 1 33.92 54.272z"/></svg>',love:'<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M171.712 571.648l.352.32 287.904 252.8a64 64 0 0 0 82.912 1.344l296.832-244.544a215.584 215.584 0 1 0-301.824-300.576L512 316.672l-25.888-35.616a215.584 215.584 0 1 0-314.4 290.624zM32 407.584A279.584 279.584 0 0 1 512 212.64a279.584 279.584 0 0 1 480 194.944 278.144 278.144 0 0 1-113.024 224.512l-295.36 243.392a128 128 0 0 1-165.888-2.592L129.984 620.16A278.976 278.976 0 0 1 32 407.584z"/></svg>',love_fill:'<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M32 407.584A279.584 279.584 0 0 1 512 212.64a279.584 279.584 0 0 1 480 194.944 278.144 278.144 0 0 1-113.024 224.512L562.592 892.8a96 96 0 0 1-124.416-1.952L130.016 620.16A278.976 278.976 0 0 1 32 407.584z"/></svg>'};getBase64=l=>{const a=this.getSVG(l);return a?.url||""};getSVG=l=>{if(!l)return;const a=this.__map[l];if(!a)return;return{url:this.toBase64(a),escape:this.toEscape(a)}};toBase64=a=>{if(!a)return"";const t=this._tiny(a);return`data:image/svg+xml;base64,${l.encode(t)}`};_tiny=l=>l?l.replace(/<!--(.*)-->/g,"").replace(/[\r\n]/g," ").replace(/"/g,"'"):"";toEscape=l=>{if(!l)return"";return`data:image/svg+xml,${this._tiny(l).replace(/%/g,"%25").replace(/&/g,"%26").replace(/#/g,"%23").replace(/{/g,"%7B").replace(/}/g,"%7D").replace(/</g,"%3C").replace(/>/g,"%3E")}`};getStyle(l,a={}){if(!l)return"";const t=this.__map[l];return t?this.toStyle(t,a):""}toStyle(l,a={}){if(!l)return"";const t=this.toBase64(l);return t?this.getStyleByUrl(t,a):""}getStyleByUrl(l,a={}){if(!l)return"";const{key:t="mask-image",gradientValue:r="radial-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5))",gradient:e=!1,defStyle:s=this.__defStyle}=a,o=e&&r?`${r}, url("${l}")`:`url("${l}")`;return`${t}:${o};-webkit-${t}:${o};${s}`}}const t=new a;export{a as DIcon,t as default};
|
package/bin/lib/class/persist.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"../modules/hook/index.js";import s from"../modules/obj/index.js";const t=(e,s,t)=>({key:e,fields:s,storage:t});class r{key;storage;fields=[];constructor(e){this.key=e?.key||"",this.fields=e?.fields||[],this.storage=e?.storage||void 0}save=e.debounce((e=>{if(this.key&&this.storage)try{const{setItem:s,setStorageSync:t}=this.storage;if(t)return t(this.key,e);if(s)return s(this.key,JSON.stringify(e))}catch(e){console.error("persit save ",e)}}));read(){if(this.key&&this.storage)try{const{getItem:e,getStorageSync:s}=this.storage;if(s)return s(this.key);if(e){const s=e(this.key);return JSON.parse(s)}}catch(e){return void console.error("persit read ",e)}}handleSave(e,t){if(!this.fields.includes(t)||!e)return;const r=s.copy(e,{fields:this.fields});this.save(r)}}export{r as default,t as persistConfig};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"../util/is.js";class t{__list=[];constructor(e){this.push(e)}push(e){return e&&this.__list.push(e),this}clear(){return this.__list=[],this}_exec(t,s){let r;if(e.isFunction(t))r=t(s);else{if(e.isPromise(t))return t.then((e=>({...s,...e})));r=t}return e.isPromise(r)?r:Promise.resolve({...r,...s})}run(e){try{return this.__list.reduce(((e,t)=>e.then((e=>this._exec(t,e)))),Promise.resolve(e)).then((e=>[void 0,e])).catch((e=>[e,void 0]))}catch(e){return Promise.reject([e,void 0])}}}export{t as default};
|
package/bin/lib/class/store.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t from"../modules/hook/index.js";import e from"./event.js";import s from"../modules/obj/index.js";import i from"../util/is.js";import n from"./persist.js";class r extends e{setters={};getters={};actions={};persist;constructor(){super()}async dispatch(e,s=void 0){const n=this,r=Reflect.get(n.actions,e);if(!i.isFunction(r))return;const[,o]=await t.run(r({...n,commit:n.commit.bind(n),query:n.query.bind(n),dispatch:n.dispatch.bind(n)},s));return o}async query(e){const i=Reflect.get(this,e);let n;if(null!=i&&""!==i)n=s.copy(i);else{const[,s]=await t.exec((()=>this.dispatch(e)),`${this.__eventId}_${e}`);n=s}return n}commit(t,e){i.isObject(e)&&(e=s.copy(e)),this[t]=e}}const o=(t,e)=>{const s=Object.assign(new r,t||{});s.__persist=new n(e||s.persist);const o=s.__persist.read(),c=o?Object.assign(s,o):s;return new Proxy(c,{get:(t,e,s)=>{const n=Reflect.get(t.getters,e);return i.isFunction(n)?n(t):Reflect.get(t,e,s)},set:(t,e,s,n)=>{const r=Reflect.get(t.setters,e);if(i.isFunction(r)&&!r(t,s))return!0;const o=Reflect.set(t,e,s,n);return o&&(t.emit(e.toString(),s),t?.__persist?.handleSave(t,e.toString())),o},has:(t,e)=>Reflect.has(t,e)})};export{r as default,o as storeRef};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import o from"./_root.js";const t=o.Symbol;export{t as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const l="object"==typeof global&&null!==global&&global.Object===Object&&global;export{l as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t from"./_Symbol.js";const{toString:e,hasOwnProperty:n,propertyIsEnumerable:o}=Object.prototype,r=t?t.toStringTag:void 0;function c(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":r&&r in Object(t)?function(t){const o=n.call(t,r),c=t[r];let l=!1;try{t[r]=void 0,l=!0}catch(t){}const a=e.call(t);return l&&(o?t[r]=c:delete t[r]),a}(t):e.call(t)}var l={getTag:c,getType:function(t){return(c(t).match(/\w+/g)||["object","Undefined"])[1]||""},toString:e,hasOwnProperty:n,propertyIsEnumerable:o};export{l as default};
|
package/bin/lib/common/_root.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import l from"./_freeGlobal.js";const e="object"==typeof globalThis&&null!==globalThis&&globalThis.Object===Object&&globalThis,t="object"==typeof self&&null!==self&&self.Object===Object&&self,o=e||l||t||Function("return this")();export{o as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function t(t){return t.split("")}export{t as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t from"./slice.js";function o(o,e,n){const{length:r}=o;return n=void 0===n?r:n,!e&&n>=r?o:t(o,e,n)}export{o as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import r from"./castSlice.js";import o from"./hasUnicode.js";import t from"./stringToArray.js";function i(i){return n=>{if(!n)return"";const s=o(n)?t(n):void 0,e=s?s[0]:n[0],c=s?r(s,1).join(""):n.slice(1);return e[i]()+c}}export{i as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const f=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff\\ufe0e\\ufe0f]");function u(u){return f.test(u)}export{u as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"../_freeGlobal.js";const o="object"==typeof exports&&null!==exports&&!exports.nodeType&&exports,t=o&&"object"==typeof module&&null!==module&&!module.nodeType&&module,r=t&&t.exports===o&&e.process,l=(()=>{try{const e=t&&t.require&&t.require("util").types;return e||r&&r.binding&&r.binding("util")}catch(e){}})();export{l as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function n(n,t,e){let l=null==n?0:n.length;if(!l)return[];(t=null==t?0:t)<0&&(t=-t>l?0:l+t),(e=(e=void 0===e?l:e)>l?l:e)<0&&(e+=l),l=t>e?0:e-t>>>0,t>>>=0;let r=-1;const u=new Array(l);for(;++r<l;)u[r]=n[r+t];return u}export{n as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import r from"./asciiToArray.js";import o from"./hasUnicode.js";import i from"./unicodeToArray.js";function t(t){return o(t)?i(t):r(t)}export{t as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const f="\\ud800-\\udfff",u=`[${f}]`,d="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff]",$="\\ud83c[\\udffb-\\udfff]",e=`[^${f}]`,c="(?:\\ud83c[\\udde6-\\uddff]){2}",n="[\\ud800-\\udbff][\\udc00-\\udfff]",t=`${`(?:${d}|${$})`}?`,a="[\\ufe0e\\ufe0f]?",o=a+t+`(?:\\u200d(?:${[e,c,n].join("|")})${a+t})*`,b=`(?:${[`${e}${d}?`,d,c,n,u].join("|")})`,i=RegExp(`${$}(?=${$})|${b+o}`,"g");function r(f){return f.match(i)||[]}export{r as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const u="\\ud800-\\udfff",f="\\u2700-\\u27bf",d="a-z\\xdf-\\xf6\\xf8-\\xff",$="A-Z\\xc0-\\xd6\\xd8-\\xde",x="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",e="['’]",a=`[${x}]`,b=`[${f}]`,n=`[${d}]`,t=`[^${u}${x+"\\d"+f+d+$}]`,c="(?:\\ud83c[\\udde6-\\uddff]){2}",o="[\\ud800-\\udbff][\\udc00-\\udfff]",i=`[${$}]`,r=`(?:${n}|${t})`,j=`(?:${i}|${t})`,s=`(?:${e}(?:d|ll|m|re|s|t|ve))?`,l=`(?:${e}(?:D|LL|M|RE|S|T|VE))?`,D="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff]|\\ud83c[\\udffb-\\udfff])?",E="[\\ufe0e\\ufe0f]?",R=E+D+`(?:\\u200d(?:${[`[^${u}]`,c,o].join("|")})${E+D})*`,T=`(?:${[b,c,o].join("|")})${R}`,g=RegExp([`${i}?${n}+${s}(?=${[a,i,"$"].join("|")})`,`${j}+${l}(?=${[a,i+r,"$"].join("|")})`,`${i}?${r}+${s}`,`${i}+${l}`,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",T].join("|"),"g");function h(u){return u.match(g)}export{h as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t from"../../util/is.js";var r={bytes2str:r=>{if(!r||!t.isArrayLike(r))return"";return r.reduce(((t,r)=>t+String.fromCharCode(r)),"")},str2bytes:(t="")=>{const r=t,e=new Uint8Array(r.length);for(let t=0,n=r.length;t<n;t++)e[t]=r.charCodeAt(t);return e},str2hex:t=>{let r="";for(let e=0;e<t.length;e++)r+=t.charCodeAt(e).toString(16).padStart(2,"0");return r},hex2str:t=>{let r="";for(let e=0;e<t.length;e+=2)r+=String.fromCharCode(parseInt(t.substr(e,2),16));return r},concatBytes:(...t)=>{const r=t.reduce(((t,r)=>t+r.length),0),e=new Uint8Array(r);let n=0;for(const r of t)e.set(r,n),n+=r.length;return e},uint32ToBytes:t=>{const r=new Uint8Array(8);return r[0]=t[0]>>>24&255,r[1]=t[0]>>>16&255,r[2]=t[0]>>>8&255,r[3]=255&t[0],r[4]=t[1]>>>24&255,r[5]=t[1]>>>16&255,r[6]=t[1]>>>8&255,r[7]=255&t[1],r},bytesToUint32:t=>{const r=new Uint32Array(2);return r[0]=t[0]<<24|t[1]<<16|t[2]<<8|t[3],r[1]=t[4]<<24|t[5]<<16|t[6]<<8|t[7],r},hex2bytes:t=>{let r=new Uint8Array(t.length/2);for(let e=0;e<r.length;e++)r[e]=parseInt(t.substr(2*e,2),16);return r},bytes2hex:t=>Array.from(t).map((t=>t.toString(16).padStart(2,"0"))).join(""),toUint32:t=>{const r=Math.ceil(t.length/4),e=new Uint32Array(r);for(let n=0;n<r;n++)e[n]=t.charCodeAt(4*n)<<24|t.charCodeAt(4*n+1)<<16|t.charCodeAt(4*n+2)<<8|t.charCodeAt(4*n+3);return e},fromUint32:t=>{let r="";for(let e=0;e<t.length;e++)r+=String.fromCharCode(t[e]>>>24&255,t[e]>>>16&255,t[e]>>>8&255,255&t[e]);return r.replace(/\0+$/,"")},flatten:function t(r,e=!1,n=[]){for(let o=0;o<r.length;o+=1){const a=r[o];e&&Array.isArray(a)?t(a,e,n):n.push(a)}return n}};export{r as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import r from"./utf8.js";import t from"../../util/is.js";const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var a={toBase64:(t="")=>{let a,h,i,o,f,n,A,c="",s=0;for(t=r.toUtf8(t);s<t.length;)a=t.charCodeAt(s++),h=t.charCodeAt(s++),i=t.charCodeAt(s++),o=a>>2,f=(3&a)<<4|h>>4,n=(15&h)<<2|i>>6,A=63&i,isNaN(h)?n=A=64:isNaN(i)&&(A=64),c=c+e.charAt(o)+e.charAt(f)+e.charAt(n)+e.charAt(A);return c},fromBase64:(t="")=>{let a,h,i,o,f,n,A,c="",s=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");s<t.length;)o=e.indexOf(t.charAt(s++)),f=e.indexOf(t.charAt(s++)),n=e.indexOf(t.charAt(s++)),A=e.indexOf(t.charAt(s++)),a=o<<2|f>>4,h=(15&f)<<4|n>>2,i=(3&n)<<6|A,c+=String.fromCharCode(a),64!=n&&(c+=String.fromCharCode(h)),64!=A&&(c+=String.fromCharCode(i));return c=r.fromUtf8(c),c},bytesToBase64:r=>{let a,h,i,o,f,n,A,c="",s=0;if(!r||!t.isArrayLike(r)||!t.isUint8Array(r))return"";for(;s<r.length;)a=r[s++],h=r[s++],i=r[s++],o=a>>2,f=(3&a)<<4|h>>4,n=(15&h)<<2|i>>6,A=63&i,isNaN(h)?n=A=64:isNaN(i)&&(A=64),c=c+e.charAt(o)+e.charAt(f)+e.charAt(n)+e.charAt(A);return c},base64ToBytes:(r="")=>{let t,a,h,i,o,f,n,A=[],c=0;for(r=r.replace(/[^A-Za-z0-9\+\/\=]/g,"");c<r.length;)i=e.indexOf(r.charAt(c++)),o=e.indexOf(r.charAt(c++)),f=e.indexOf(r.charAt(c++)),n=e.indexOf(r.charAt(c++)),t=i<<2|o>>4,a=(15&o)<<4|f>>2,h=(3&f)<<6|n,A.push(t),64!=f&&A.push(a),64!=n&&A.push(h);return new Uint8Array(A)}};export{a as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t from"./base64.js";import r from"../../util/is.js";import e from"./utf8.js";import o from"../math/index.js";import s from"./base.js";import a from"./pkcs.js";import f from"./md5.js";const n=(r,e=!1)=>{const o=new Uint8Array(r);return e?t.bytesToBase64(o):o.reduce(((t,r)=>t+String.fromCharCode(r)),"")};var i={...s,...a,...e,...t,...f,str2ab:(r="",e=!1)=>{if(e)return t.base64ToBytes(r).buffer;{const t=new ArrayBuffer(r.length),e=new Uint8Array(t);for(let t=0,o=r.length;t<o;t++)e[t]=r.charCodeAt(t);return t}},ab2str:n,utf8ToBase64:t=>r.isBrowser?btoa(t):Buffer.from(t,"utf-8").toString("base64"),base64ToUtf8:t=>r.isBrowser?atob(t):Buffer.from(t,"base64").toString("utf-8"),getRandomBytes:t=>{const r=new Uint8Array(t);for(let e=0;e<t;e++)r[e]=o.random(256);return r},textEncode:t=>e.toUtf8Bytes(t),textDecode:t=>e.fromUtf8Bytes(new Uint8Array(t)),toDataUrl:(e,o="text/plain")=>e?"string"==typeof e?`data:${o};base64,`+t.toBase64(e):r.isArrayBuffer(e)?`data:${o};base64,`+n(e,!0):"":""};export{i as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t from"./utf8.js";import n from"./base.js";import r from"./base64.js";function e(t,n){return t<<n|t>>>32-n}function o(t,n){let r,e,o,u,f;return o=2147483648&t,u=2147483648&n,r=1073741824&t,e=1073741824&n,f=(1073741823&t)+(1073741823&n),r&e?2147483648^f^o^u:r|e?1073741824&f?3221225472^f^o^u:1073741824^f^o^u:f^o^u}function u(t,n,r,u,f,i,s){return t=o(t,o(o(function(t,n,r){return t&n|~t&r}(n,r,u),f),s)),o(e(t,i),n)}function f(t,n,r,u,f,i,s){return t=o(t,o(o(function(t,n,r){return t&r|n&~r}(n,r,u),f),s)),o(e(t,i),n)}function i(t,n,r,u,f,i,s){return t=o(t,o(o(function(t,n,r){return t^n^r}(n,r,u),f),s)),o(e(t,i),n)}function s(t,n,r,u,f,i,s){return t=o(t,o(o(function(t,n,r){return n^(t|~r)}(n,r,u),f),s)),o(e(t,i),n)}function c(t){let n,r,e="",o="";for(r=0;r<=3;r++)n=t>>>8*r&255,o="0"+n.toString(16),e+=o.substr(o.length-2,2);return e}function l(t){let n,r,e,l,a,m,y,g,p,b=[];for(b=function(t){let n;const r=t.length,e=r+8,o=16*((e-e%64)/64+1),u=Array(o-1).fill(0);let f=0,i=0;for(;i<r;)n=(i-i%4)/4,f=i%4*8,u[n]=u[n]|t[i]<<f,i++;return n=(i-i%4)/4,f=i%4*8,u[n]=u[n]|128<<f,u[o-2]=r<<3,u[o-1]=r>>>29,u}(t),m=1732584193,y=4023233417,g=2562383102,p=271733878,n=0;n<b.length;n+=16)r=m,e=y,l=g,a=p,m=u(m,y,g,p,b[n+0],7,3614090360),p=u(p,m,y,g,b[n+1],12,3905402710),g=u(g,p,m,y,b[n+2],17,606105819),y=u(y,g,p,m,b[n+3],22,3250441966),m=u(m,y,g,p,b[n+4],7,4118548399),p=u(p,m,y,g,b[n+5],12,1200080426),g=u(g,p,m,y,b[n+6],17,2821735955),y=u(y,g,p,m,b[n+7],22,4249261313),m=u(m,y,g,p,b[n+8],7,1770035416),p=u(p,m,y,g,b[n+9],12,2336552879),g=u(g,p,m,y,b[n+10],17,4294925233),y=u(y,g,p,m,b[n+11],22,2304563134),m=u(m,y,g,p,b[n+12],7,1804603682),p=u(p,m,y,g,b[n+13],12,4254626195),g=u(g,p,m,y,b[n+14],17,2792965006),y=u(y,g,p,m,b[n+15],22,1236535329),m=f(m,y,g,p,b[n+1],5,4129170786),p=f(p,m,y,g,b[n+6],9,3225465664),g=f(g,p,m,y,b[n+11],14,643717713),y=f(y,g,p,m,b[n+0],20,3921069994),m=f(m,y,g,p,b[n+5],5,3593408605),p=f(p,m,y,g,b[n+10],9,38016083),g=f(g,p,m,y,b[n+15],14,3634488961),y=f(y,g,p,m,b[n+4],20,3889429448),m=f(m,y,g,p,b[n+9],5,568446438),p=f(p,m,y,g,b[n+14],9,3275163606),g=f(g,p,m,y,b[n+3],14,4107603335),y=f(y,g,p,m,b[n+8],20,1163531501),m=f(m,y,g,p,b[n+13],5,2850285829),p=f(p,m,y,g,b[n+2],9,4243563512),g=f(g,p,m,y,b[n+7],14,1735328473),y=f(y,g,p,m,b[n+12],20,2368359562),m=i(m,y,g,p,b[n+5],4,4294588738),p=i(p,m,y,g,b[n+8],11,2272392833),g=i(g,p,m,y,b[n+11],16,1839030562),y=i(y,g,p,m,b[n+14],23,4259657740),m=i(m,y,g,p,b[n+1],4,2763975236),p=i(p,m,y,g,b[n+4],11,1272893353),g=i(g,p,m,y,b[n+7],16,4139469664),y=i(y,g,p,m,b[n+10],23,3200236656),m=i(m,y,g,p,b[n+13],4,681279174),p=i(p,m,y,g,b[n+0],11,3936430074),g=i(g,p,m,y,b[n+3],16,3572445317),y=i(y,g,p,m,b[n+6],23,76029189),m=i(m,y,g,p,b[n+9],4,3654602809),p=i(p,m,y,g,b[n+12],11,3873151461),g=i(g,p,m,y,b[n+15],16,530742520),y=i(y,g,p,m,b[n+2],23,3299628645),m=s(m,y,g,p,b[n+0],6,4096336452),p=s(p,m,y,g,b[n+7],10,1126891415),g=s(g,p,m,y,b[n+14],15,2878612391),y=s(y,g,p,m,b[n+5],21,4237533241),m=s(m,y,g,p,b[n+12],6,1700485571),p=s(p,m,y,g,b[n+3],10,2399980690),g=s(g,p,m,y,b[n+10],15,4293915773),y=s(y,g,p,m,b[n+1],21,2240044497),m=s(m,y,g,p,b[n+8],6,1873313359),p=s(p,m,y,g,b[n+15],10,4264355552),g=s(g,p,m,y,b[n+6],15,2734768916),y=s(y,g,p,m,b[n+13],21,1309151649),m=s(m,y,g,p,b[n+4],6,4149444226),p=s(p,m,y,g,b[n+11],10,3174756917),g=s(g,p,m,y,b[n+2],15,718787259),y=s(y,g,p,m,b[n+9],21,3951481745),m=o(m,r),y=o(y,e),g=o(g,l),p=o(p,a);return c(m)+c(y)+c(g)+c(p)}const a=n=>{if("string"!=typeof n&&!(n instanceof Uint8Array))return"";return l("string"==typeof n?t.toUtf8Bytes(n):n)};var m={md5:a,md5Base64:t=>{const e=a(t);if(!e)return"";const o=n.hex2bytes(e);return r.bytesToBase64(o)}};export{m as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import n from"./base.js";var t={pkcs7Padding:(t,e)=>{const r=e-t.length%e,s=new Uint8Array(r).fill(r);return n.concatBytes(t,s)},pkcs7Unpadding:n=>{const t=n[n.length-1];return n.slice(0,-t)}};export{t as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var r={toUtf8:r=>{if(!r)return"";const t=r.replace(/\r\n/g,"\n");let e="";for(let r=0;r<t.length;r++){let o=t.charCodeAt(r);o<128?e+=String.fromCharCode(o):o>127&&o<2048?(e+=String.fromCharCode(o>>6|192),e+=String.fromCharCode(63&o|128)):(e+=String.fromCharCode(o>>12|224),e+=String.fromCharCode(o>>6&63|128),e+=String.fromCharCode(63&o|128))}return e},fromUtf8:r=>{let t="",e=0;if(!r)return"";let o=0,n=0,C=0;for(;e<r.length;)o=r.charCodeAt(e),o<128?(t+=String.fromCharCode(o),e++):o>191&&o<224?(n=r.charCodeAt(e+1),t+=String.fromCharCode((31&o)<<6|63&n),e+=2):(n=r.charCodeAt(e+1),C=r.charCodeAt(e+2),t+=String.fromCharCode((15&o)<<12|(63&n)<<6|63&C),e+=3);return t},toUtf8Bytes:r=>{if(!r)return new Uint8Array;const t=r.replace(/\r\n/g,"\n"),e=[];for(let r=0;r<t.length;r++){let o=t.charCodeAt(r);o<128?e.push(o):o<2048?(e.push(o>>6|192),e.push(63&o|128)):(e.push(o>>12|224),e.push(o>>6&63|128),e.push(63&o|128))}return new Uint8Array(e)},fromUtf8Bytes:r=>{let t="",e=0;if(!r||r.length<=0)return"";for(;e<r.length;){let o=r[e];if(o<128)t+=String.fromCharCode(o),e++;else if(o>191&&o<224){const n=r[e+1];t+=String.fromCharCode((31&o)<<6|63&n),e+=2}else{const n=r[e+1],C=r[e+2];t+=String.fromCharCode((15&o)<<12|(63&n)<<6|63&C),e+=3}}return t}};export{r as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"../convert/base64.js";const o=o=>e.toBase64(o);var a={encode:o,decode:o=>e.fromBase64(o),encodeByOss:e=>o(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")};export{a as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e="0123456789",r="abcdefghijklmnopqrstuvwxyz",a="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var k={keyNumber:e,keyLower:r,keyUpper:a,keyChars:e+r+a};export{k as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t from"../time/index.js";import r from"./base64.js";import o from"./const.js";import e from"./uuid.js";import m from"./tea.js";var s={...o,base64:r,tea:m,uuid:e,guid:(r,o=!1,m="")=>{const s=e(r||32);return o?t.now().format("yyyyMMddhhmmss")+m+s:s},getHexString:t=>{const r=o.keyChars;let e="";const m=r.length;for(let o=0;o<t;o++)e+=r.charAt(Math.floor(Math.random()*m));return e}};export{s as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"../convert/index.js";const n=n=>{try{const t=e.ab2str(n,!0);return t.match(/.{1,64}/g)?.join("\n")||""}catch(e){return""}},t=(e="",n="PUBLIC KEY")=>`-----BEGIN ${n}-----\n${e}\n-----END ${n}-----`;var r={RSAPublicKey:"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApiLWsPmoaiGdr02AmPYS\n4/VgxyJNNJSK2VICirXl4P8qAP3b/6GIs7Hwnsmmuj7gledJ0XiZodFjDNgQEZEG\nj4K9KX8NixcrJwnTQV5UebiERdj+64ihwqPVWo9dIOj43ZPJ8f4dritJv5tnQaBb\nb9zTkU3Ofzk1g8RU00Ith6quOGZcU2IWC4OQ+5YiZvzrCBKEvjFwK2OvGq43tI51\nGaZdI9H09jisypqefsMvv6esjEQQOtl+WGlI5fof7KZUt3dppvuDI4CYgeXIoKKL\n9T9qDl8F9aNSs3XHx32YyA7L1FraFD6PjqRjueIFp2emsXQcIMeMqqgVyV+4qb+0\nuwIDAQAB",RSAPrivateKey:"MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCmItaw+ahqIZ2v\nTYCY9hLj9WDHIk00lIrZUgKKteXg/yoA/dv/oYizsfCeyaa6PuCV50nReJmh0WMM\n2BARkQaPgr0pfw2LFysnCdNBXlR5uIRF2P7riKHCo9Vaj10g6Pjdk8nx/h2uK0m/\nm2dBoFtv3NORTc5/OTWDxFTTQi2Hqq44ZlxTYhYLg5D7liJm/OsIEoS+MXArY68a\nrje0jnUZpl0j0fT2OKzKmp5+wy+/p6yMRBA62X5YaUjl+h/splS3d2mm+4MjgJiB\n5cigoov1P2oOXwX1o1KzdcfHfZjIDsvUWtoUPo+OpGO54gWnZ6axdBwgx4yqqBXJ\nX7ipv7S7AgMBAAECggEAE1kuWLkSsJ2OoDpt9iJ+a7cJmNd5V1zPWOTwr9fkWFJP\nQYNPKlPVOFxKUivY84rcHAkuMyuQ9OQOXZISOQGDWpZW0mzeFmtR1r+Rr2S9gNmI\n6huOAL9OW306HUxiA7GuPhv2omy+Zyjac2q1WVLEI2B78Um2+WEfxuNIH7xu0gRR\nz/wluevMBQlv6hSeMESP6e9s2kB+FuM4bL7+1sexwS1TudKbHybujaiB8un9E2V3\nC9BkE6yf00Rhvii6Q4E4w3PFQfcBEFnjOD0S2Watx8GIbYjlYvtquy8Yj7OtyZB6\nw5sxyaYhKVVnkpGAbOgaCj94ABYF47VuwXr45I4PzQKBgQDp6svzD+QKlARjcWgO\nrH7UEpFX6m49G6Ib4c63xEg9+GesTgfDxoYxtXDKsC7I8OwMrmffJGbyfjaAvzmg\nicM3Y7kF6UPO9+q2mBRsyhoJSNONTeUVyoFSc+QDsVgndlTZIjqC5XLrONGaSPLJ\n7jJzqKhp3NQcpO8+xY0d7Efm1QKBgQC10fCNuF1LUTYgsWvvGxTiCCAIBurZmHU+\nGMb2Okfoco/P+QNl1jEba91AC7FudW3g/lRn0vTnDajlNoz2/CKunrTKN4/9lEBI\ntiwEOvhc5FtapRifSfrrNwFqPM+LijvOkcteWVhAUWCEP1eLmpnXGqfmZxnTaaVe\n5DyDgyAVTwKBgQDhEawfOQEANJ9sV2f6BnsZ7quuXcCoR3hZP5G5O8EO735BSesq\nsk/YcG4QeCjr6vQU15LWH552YH5srpHyJ9uP5gHW8DTwZZaPDhFJA8S9fjcfVP3B\nU9HO1fdknjTl83N8YPTPkZpbPZZfzyTcqrYclwFEqtfkn8YbLdW0Hu6n6QKBgDEv\njvS3uD1ExfDILlurptWSvx+Mx4F/1c+roj8/+u3t9+uaAIpPDE/PuTW3NBOens/r\n3WeM0QWkU1lWjYHPKY61jlDaARDnRxCkf3nRfhibCf+Wg/erar6wzagwtTCZf55d\nIHfwkYgsu4BrJkK02wMuydbxczIW9U6bTaeCFG7PAoGAN3oHYzTEBwZ7ZKv11QiQ\nEp/HeHBvD8fH/e1uVyBel4Co7NO5pV2s8qjS8+3+jxumKLNXCirjqwHo03YCdzxi\ncy4GFDsukHmDQ7FF9VC4QV0fJ0F7jGYE9nNZ+K9qwS5KrihOSBPxj0HptrF6TSOw\nBTSwr0byL3TC0m0StkSNKpo=",generateKeys:async e=>{try{const r=await e.generateKey({name:"RSA-OAEP",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:"SHA-256"},!0,["encrypt","decrypt"]),a=await window.crypto.subtle.exportKey("spki",r.publicKey),c=n(a),o=t(c,"PUBLIC KEY"),y=await window.crypto.subtle.exportKey("pkcs8",r.privateKey),s=n(y);return{publicKey:c,publicKeyPem:o,privateKey:s,privateKeyPem:t(s,"PRIVATE KEY")}}catch(e){return console.error("generateKeys failed:",e),{publicKey:"",publicKeyPem:"",privateKey:"",privateKeyPem:""}}},format_pem_key:t,format_pem_content:n,encrypt:async(n,t,r)=>{try{const a=(new TextEncoder).encode(t),c=await n.importKey("spki",e.str2ab(r,!0),{name:"RSA-OAEP",hash:"SHA-256"},!0,["encrypt"]),o=[];for(let e=0;e<a.length;e+=190){let t=a.slice(e,e+190),r=await n.encrypt({name:"RSA-OAEP"},c,t);o.push(new Uint8Array(r))}const y=e.concatBytes(...o);return e.bytesToBase64(y)}catch(e){return console.error("[debug] encrypt",e),""}},decrypt:async(n,t,r)=>{try{const a=e.base64ToBytes(t),c=await n.importKey("pkcs8",e.str2ab(r,!0),{name:"RSA-OAEP",hash:"SHA-256"},!0,["decrypt"]),o=[],y=256;for(let e=0;e<a.length;e+=y){let t=a.slice(e,e+y),r=await n.decrypt({name:"RSA-OAEP"},c,t);o.push(new Uint8Array(r))}const s=e.concatBytes(...o);return(new TextDecoder).decode(s)}catch(e){return console.error("decrypt failed:",e),""}}};export{r as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"../convert/index.js";const t=2654435769,n=(e,n)=>{let o=0;for(let s=0;s<32;s++)o=o+t>>>0,e[0]=e[0]+((e[1]<<4)+n[0]^e[1]+o^(e[1]>>>5)+n[1])>>>0,e[1]=e[1]+((e[0]<<4)+n[2]^e[0]+o^(e[0]>>>5)+n[3])>>>0;return e},o=(e,n)=>{let o=3337565984;for(let s=0;s<32;s++)e[1]=e[1]-((e[0]<<4)+n[2]^e[0]+o^(e[0]>>>5)+n[3])>>>0,e[0]=e[0]-((e[1]<<4)+n[0]^e[1]+o^(e[1]>>>5)+n[1])>>>0,o=o-t>>>0;return e},s=t=>{const n=e.str2bytes(t),o=new Uint32Array(4);return o[0]=n[0]<<24|n[1]<<16|n[2]<<8|n[3],o[1]=n[4]<<24|n[5]<<16|n[6]<<8|n[7],o[2]=n[8]<<24|n[9]<<16|n[10]<<8|n[11],o[3]=n[12]<<24|n[13]<<16|n[14]<<8|n[15],o},r=(t,o)=>{const r=e.pkcs7Padding(t,8),c=s(o),y=[];for(let t=0;t<r.length;t+=8){const o=e.bytesToUint32(r.slice(t,t+8)),s=n(o,c);y.push(e.uint32ToBytes(s))}return e.concatBytes(...y)},c=(t,n)=>{const r=s(n),c=[];for(let n=0;n<t.length;n+=8){const s=e.bytesToUint32(t.slice(n,n+8)),y=o(s,r);c.push(e.uint32ToBytes(y))}const y=e.concatBytes(...c);return e.pkcs7Unpadding(y)};var y={TEAKey:"33576f37387276645054657a6831686e454664424e5652456f47794835795942",encrypt:n,decrypt:o,toTeaKey:s,encode:(t,n)=>{const o=e.textEncode(t),s=r(o,n);return e.bytesToBase64(s)},decode:(t,n)=>{const o=e.base64ToBytes(t),s=c(o,n);return e.textDecode(s.buffer)},encodeBytes:r,decodeBytes:c};export{y as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t from"./const.js";const o=(o=0,r=0)=>{const e=t.keyChars.split(""),n=[];let s;if(r=r||e.length,o)for(s=0;s<o;s++)n[s]=e[0|Math.random()*r];else{let t;for(n[8]=n[13]=n[18]=n[23]="-",n[14]="4",s=0;s<36;s++)n[s]||(t=0|16*Math.random(),n[s]=e[19==s?3&t|8:t])}return n.join("")};export{o as default};
|
package/bin/lib/modules/css.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import r from"../util/index.js";import t from"./qs/index.js";import o from"./rule/index.js";import i from"./string/index.js";const e=t=>{if(!t)return"";if(!r.isObject(t))return"";let o="";return r.forof(t,((r,t)=>{t&&(o+=`${i.kebabCase(r)}:${t};`)})),o},n=["display","position","top","bottom","left","right","padding","margin","marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft","height","width","fontSize","textAlign","fontFamily","border","borderLeft","borderRight","borderTop","borderBottom","borderColor","borderRadius","background","backgroundImage","backgroundRepeat","backgroundSize","backgroundPosition","color","overflow","opacity","flexDirection","justifyContent","alignItems","flexWrap","alignContent","alignSelf","flex","flexBasis","flexFlow","flexShrink","pointerEvents"],a=["top","bottom","left","right","padding","margin","marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft","height","width","border","borderLeft","borderRight","borderTop","borderBottom","borderColor","borderRadius"],d=(r,t="px")=>r&&t?"0"===r?r:o.isFloat(r.toString())?`${r}${t}`:r:r;var g={stringify:e,parse:(e,{camel:n=!1,pure:a=!0}={})=>{if(!e.trim())return;const d=t.parse(e,{sep:";",eq:":",uri:!1}),g={};return r.forof(d,((r,t)=>{if(!t)return;const e=n?a&&r.startsWith("_")?r:i.camelCase(r):r;o.isFloat(t)||t.length>=2&&t.startsWith(".")&&o.isNumber(t.substr(1))?g[e]=+t:g[e]=t})),g},fixValue:d,style:(t,o="px")=>{if(!t)return"";const g=r.copy(t,{fields:n});r.forof(g,((r,t)=>{(a.includes(r)||a.includes(i.camelCase(r)))&&(g[r]=d(t,o))}));return e(g)},commonFields:n};export{g as default};
|
package/bin/lib/modules/fetch.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t from"./hook/base.js";import e from"./convert/index.js";import a from"./math/index.js";var n={getDataURL:(a,n)=>{const o={contentType:"",dataUrl:""};return t.to(fetch(a,{cache:n}).then((t=>(o.contentType=t.headers.get("content-type")||"",t.arrayBuffer()))).then((t=>(o.dataUrl=`data:${o.contentType};base64,`+e.ab2str(t,!0),o))))},getArrayBuffer:async(e,a)=>t.to(fetch(e,{cache:a}).then((t=>t.arrayBuffer()))),getJson:async(e,a)=>t.to(fetch(e,{cache:a}).then((t=>t.json()))),download:(t,e={})=>new Promise((n=>fetch(t).then((async t=>{if(!t.ok||200!==t.status)throw new Error(t.statusText);const o=+(t.headers.get("content-length")||""),c=t.body?.getReader();let r=0;const s=[];for(;;){const{done:t,value:n}=await c.read();if(t)break;s.push(n),r+=n.length;const h=a.float(100*r/o,{digits:2});e?.progress&&e?.progress(h,r,o)}const h=new Uint8Array(r);let f=0;for(const t of s)h.set(t,f),f+=t.length;e?.success&&e?.success(h),n(h)})).catch((t=>{e?.fail&&e?.fail(t),n(void 0)})))),getText:async(e,a)=>t.to(fetch(e,{cache:a}).then((t=>t.text()))),cache:async(e,a="no-cache")=>t.to(fetch(e,{cache:a}).then((()=>!0)))};export{n as default};
|
package/bin/lib/modules/gbk.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t={gbkLength:function(t){let e=0;if(!t)return 0;for(let r=0;r<t.length;r++)t.charCodeAt(r)>127||94===t.charCodeAt(r)?e+=2:e++;return e},gbkCut:function(t,e){if(!t||e<=0)return"";let r=0,n=0;for(let o=0;o<t.length&&(t.charCodeAt(o)>127||94===t.charCodeAt(o)?r+=2:r++,!(r>e));o++)n=o;return t.substr(0,n+1)}};export{t as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"../../util/is.js";async function t(e,t,o){return e.then((e=>(o&&o(),[null,e]))).catch((e=>(t&&Object.assign(e,t),o&&o(),[e,void 0])))}const o=(o,r)=>{try{let i;return i=e.isFunction(o)?o():o,t(Promise.resolve(i),void 0,r)}catch(e){return r&&r(),Promise.resolve([e,void 0])}},r=e=>"string"==typeof(e="function"==typeof e?e():e)?new Error(e):e;var i={to:t,go:(e,t)=>o(e,t),delay:(e=1e3)=>new Promise((t=>setTimeout(t,e))),safeRun:o,toError:r,timeout:(e,t=0,i="timeout")=>{if(t<=0)return o(e);let n;function s(){n&&clearTimeout(n)}const u=new Promise((e=>{s(),n=setTimeout((()=>e([r(i||"timeout"),void 0])),t)}));return Promise.race([o(e,s),u])}};export{i as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"./base.js";import t from"../../util/function.js";import s from"./modules/pipeline.js";class n extends(t.singleton()){__lockedMap=new Map;pipeline=new s;constructor(){super()}lock(t,s){if(!t||!s)return;const n=e.safeRun(s);return this.__lockedMap.set(t,n),n}unlock(e){e&&this.__lockedMap.has(e)&&this.__lockedMap.delete(e)}async exec(t,s){if(!t||!s)return e.safeRun(t);const n=this.__lockedMap.get(s);if(n)return n;const o=this.lock(s,t);if(!o)return e.safeRun(t);const r=await o;return this.unlock(s),r}}export{n as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"./modules/debounce.js";import o from"./modules/throttle.js";import s from"./modules/mutex.js";import r from"../../class/pipeTask.js";import m from"./base.js";import t from"./modules/polling.js";import i from"./hooker.js";import p from"./modules/pipeline.js";import a from"./modules/safeTask.js";import l from"./log.js";import n from"./modules/bezier.js";var u={...m,...l,...n,sleep:m.delay,run:async function(e,o=0){if(o<=0)return m.safeRun(e);const s=o>0?Date.now():0,r=await m.safeRun(e),t=Date.now()-s;return t<o&&await m.delay(o-t),r},exec:(e,o="")=>i.I.exec(e,o),debounce:e,throttle:o,task:e=>new r(e),mutex:s,polling:t,pipe:(e,o)=>i.I.pipeline.push(e,o),pipeline:(e=1)=>new p(e),safeTask:(e,o)=>new a(e,o)};export{u as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import r from"../../util/is.js";import t from"../node/rsa-web.js";import e from"../rsa.js";import o from"../crypto/tea.js";import n from"../convert/index.js";import s from"../string/index.js";var i={logString:r=>{try{const t=JSON.stringify(r);return void 0===t?"":o.encode(t,n.hex2str(o.TEAKey))}catch(r){return""}},logParse:r=>{try{if(!r)return"";const t=o.decode(r,n.hex2str(o.TEAKey));return s.jsonFormat(t)}catch(r){return""}},logRString:async o=>{try{const n=JSON.stringify(o);if(void 0===n)return"";return r.isBrowser?await e.encode(n):await t.encode(n)}catch(r){return""}},logRParse:async o=>{try{if(!o)return"";const n=r.isBrowser?await e.decode(o):await t.decode(o);return s.jsonFormat(n)}catch(r){return""}}};export{i as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=(e,r,t)=>e*(1-t)+r*t,r=(e,r,t)=>e===r?0:(t-e)/(r-e),t=(r,t,n)=>({x:e(r.x,t.x,n),y:e(r.y,t.y,n)}),n=(e,r,n,l)=>{const o=t(e,r,l),x=t(r,n,l);return t(o,x,l)},l=(e,r)=>{if(1===e.length)return e[0];const t=[];for(let n=0;n<e.length-1;n++)t.push({x:(1-r)*e[n].x+r*e[n+1].x,y:(1-r)*e[n].y+r*e[n+1].y});return l(t,r)},o=(e,r)=>{if(0===r||r===e)return 1;let t=1;for(let n=1;n<=r;n++)t=t*(e-n+1)/n;return t};var x={bezier1:t,bezier2:n,bezier3:(e,r,l,o,x)=>{const u=n(e,r,l,x),s=n(r,l,o,x);return t(u,s,x)},bezier:l,bezierCurve:(e,r)=>{const t=e.length-1;let n=0,l=0;for(let x=0;x<=t;x++){const u=o(t,x)*Math.pow(1-r,t-x)*Math.pow(r,x);n+=u*e[x].x,l+=u*e[x].y}return{x:n,y:l}},lerp:e,lerpAverage:(n,l,o="")=>{if(n.length<=0)return 0;if(1===n.length)return n[0].x;if(2===n.length)return e(n[0].y,n[1].y,.5);const x=[],u=n.slice().sort(((e,r)=>e.x-r.x)),s=u.length,i=u[0].x,f=u[s-1].x;for(let e=i;e<=f;e+=l){let n=0;for(let l=0;l<s-1;l++){const x=u[l],s=u[l+1];if(e>=x.x&&e<=s.x){if("lerp"===o){const l=r(x.x,s.x,e);n=t(x,s,l).y}else n=x.y;break}}e>u[s-1].x&&(n=u[s-1].y),x.push(n)}return x.reduce(((e,r)=>e+r),0)/x.length},proportion:r};export{x as default};
|