ddan-js 2.9.16 → 2.9.17
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/hook.d.ts +1 -1
- package/bin/store.d.ts +1 -1
- package/bin/tiny/hook.d.ts +1 -1
- package/bin/tiny/hook.js +1 -1
- package/bin/tiny/{hook.es.js → hook.mjs} +1 -1
- package/bin/tiny/store.d.ts +1 -1
- package/bin/tiny/utils.d.ts +1 -1
- package/bin/tiny/utils.js +1 -1
- package/bin/tiny/{utils.es.js → utils.mjs} +1 -1
- package/bin/tiny/web.d.ts +1 -1
- package/bin/tiny/web.js +1 -1
- package/bin/tiny/{web.es.js → web.mjs} +1 -1
- package/bin/utils.d.ts +1 -1
- package/bin/web.d.ts +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"crypto";var t={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,i=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),i=e.charCodeAt(r+2),t+=String.fromCharCode((15&n)<<12|(63&o)<<6|63&i),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],i=e[r+2];t+=String.fromCharCode((15&n)<<12|(63&o)<<6|63&i),r+=3}}return t}};const r="object"==typeof global&&null!==global&&global.Object===Object&&global,n="object"==typeof globalThis&&null!==globalThis&&globalThis.Object===Object&&globalThis,o="object"==typeof self&&null!==self&&self.Object===Object&&self,i=n||r||o||Function("return this")(),s=i.Symbol,{toString:a,hasOwnProperty:u,propertyIsEnumerable:l}=Object.prototype,c=s?s.toStringTag:void 0;function f(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":c&&c in Object(e)?function(e){const t=u.call(e,c),r=e[c];let n=!1;try{e[c]=void 0,n=!0}catch(e){}const o=a.call(e);return n&&(t?e[c]=r:delete e[c]),o}(e):a.call(e)}var d={getTag:f,getType:function(e){return(f(e).match(/\w+/g)||["object","Undefined"])[1]||""},toString:a,hasOwnProperty:u,propertyIsEnumerable:l};const h="object"==typeof exports&&null!==exports&&!exports.nodeType&&exports,p=h&&"object"==typeof module&&null!==module&&!module.nodeType&&module,g=p&&p.exports===h&&r.process,y=(()=>{try{const e=p&&p.require&&p.require("util").types;return e||g&&g.binding&&g.binding("util")}catch(e){}})();var m="[object Function]",b="[object GeneratorFunction]",w="[object AsyncFunction]",v=9007199254740991;const x=/^(?:0|[1-9]\d*)$/,A=i?.Buffer?.isBuffer,j=/^\[object (?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)Array\]$/,O=y&&y.isTypedArray;function $(e){const t=typeof e;return null!=e&&("object"==t||"function"==t)}function C(e){return null!=e&&"object"==typeof e}const k=Array.isArray;function B(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=v}(e.length)&&!E(e)}function q(e){return C(e)&&B(e)}function E(e){var t=$(e)?d.getTag(e):"";return t===m||t===b||t===w}function _(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Object.prototype)}function P(e){return q(e)&&d.hasOwnProperty.call(e,"callee")&&(!d.propertyIsEnumerable.call(e,"callee")||"[object Arguments]"==d.toString.call(e))}const F="undefined"!=typeof window&&void 0!==window.document,S="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,T=O?e=>O(e):e=>C(e)&&j.test(d.getTag(e)),U="function"==typeof A?A:()=>!1;var R={is:function(e,t){return d.getTag(e)===`[object ${t}]`},isNumber:function(e){return"[object Number]"===d.getTag(e)},isString:function(e){return"string"==typeof e||!k(e)&&C(e)&&"[object String]"==d.getTag(e)},isObject:$,isObjectLike:C,isPlainObject:function(e){if(!C(e)||"[object Object]"!=d.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||C(e)&&"[object Symbol]"===d.getTag(e)},isFunction:E,isArray:k,isArrayLikeObject:q,isIndex:function(e,t){return!!(t=null==t?v:t)&&("number"==typeof e||x.test(e))&&e>-1&&e%1==0&&e<t},isArrayLike:B,isPrototype:_,isArguments:P,isPromise:function(e){return"[object Promise]"===($(e)?d.getTag(e):"")},isBrowser:F,isNode:S,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)||T(e)||P(e)))return!e.length;const t=d.getTag(e);if("[object Map]"===t||"[object Set]"===t)return!e.size;if(_(e))return!Object.keys(e).length;for(const t in e)if(d.hasOwnProperty.call(e,t))return!1;return!0}};const L="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var I={toBase64:(e="")=>{let r,n,o,i,s,a,u,l="",c=0;for(e=t.toUtf8(e);c<e.length;)r=e.charCodeAt(c++),n=e.charCodeAt(c++),o=e.charCodeAt(c++),i=r>>2,s=(3&r)<<4|n>>4,a=(15&n)<<2|o>>6,u=63&o,isNaN(n)?a=u=64:isNaN(o)&&(u=64),l=l+L.charAt(i)+L.charAt(s)+L.charAt(a)+L.charAt(u);return l},fromBase64:(e="")=>{let r,n,o,i,s,a,u,l="",c=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");c<e.length;)i=L.indexOf(e.charAt(c++)),s=L.indexOf(e.charAt(c++)),a=L.indexOf(e.charAt(c++)),u=L.indexOf(e.charAt(c++)),r=i<<2|s>>4,n=(15&s)<<4|a>>2,o=(3&a)<<6|u,l+=String.fromCharCode(r),64!=a&&(l+=String.fromCharCode(n)),64!=u&&(l+=String.fromCharCode(o));return l=t.fromUtf8(l),l},bytesToBase64:e=>{let t,r,n,o,i,s,a,u="",l=0;if(!e||!R.isArrayLike(e)||!R.isUint8Array(e))return"";for(;l<e.length;)t=e[l++],r=e[l++],n=e[l++],o=t>>2,i=(3&t)<<4|r>>4,s=(15&r)<<2|n>>6,a=63&n,isNaN(r)?s=a=64:isNaN(n)&&(a=64),u=u+L.charAt(o)+L.charAt(i)+L.charAt(s)+L.charAt(a);return u},base64ToBytes:(e="")=>{let t,r,n,o,i,s,a,u=[],l=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");l<e.length;)o=L.indexOf(e.charAt(l++)),i=L.indexOf(e.charAt(l++)),s=L.indexOf(e.charAt(l++)),a=L.indexOf(e.charAt(l++)),t=o<<2|i>>4,r=(15&i)<<4|s>>2,n=(3&s)<<6|a,u.push(t),64!=s&&u.push(r),64!=a&&u.push(n);return new Uint8Array(u)}};const N=e=>I.toBase64(e);var z=N;const M=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,${z(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:i=this.__defStyle}=t,s=o&&n?`${n}, url("${e}")`:`url("${e}")`;return`${r}:${s};-webkit-${r}:${s};${i}`}},D=NaN,K=/^\s+|\s+$/g,V=/^[-+]0x[0-9a-f]+$/i,H=/^0b[01]+$/i,W=/^0o[0-7]+$/i,Z=parseInt,Q=1/0,Y=17976931348623157e292;function J(e){if("number"==typeof e)return e;if(R.isSymbol(e))return D;if(R.isObject(e)){const t="function"==typeof e.valueOf?e.valueOf():e;e=R.isObject(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(K,"");const t=H.test(e);return t||W.test(e)?Z(e.slice(2),t?2:8):V.test(e)?D:+e}function G(e){return e?(e=J(e))===Q||e===-Q?(e<0?-1:1)*Y:e==e?e:0:0===e?e:0}var X={toNumber:J,toFinite:G,toInteger:function(e){var t=G(e),r=t%1;return t==t?r?t-r:t:0}};function ee(e){return e!=e}function te(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 re,ne,oe=(re=Object.keys,ne=Object,function(e){return re(ne(e))}),ie=Math.max;function se(e,t){var r=R.isArray(e)||R.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 i in e)!t&&!d.hasOwnProperty.call(e,i)||o&&("length"==i||R.isIndex(i,n))||r.push(i);return r}function ae(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 i=new Array(n);for(;++o<n;)i[o]=e[o+t];return i}(e,t,r)}const ue=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff\\ufe0e\\ufe0f]");function le(e){return ue.test(e)}const ce="\\ud800-\\udfff",fe=`[${ce}]`,de="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff]",he="\\ud83c[\\udffb-\\udfff]",pe=`[^${ce}]`,ge="(?:\\ud83c[\\udde6-\\uddff]){2}",ye="[\\ud800-\\udbff][\\udc00-\\udfff]",me=`${`(?:${de}|${he})`}?`,be="[\\ufe0e\\ufe0f]?",we=be+me+`(?:\\u200d(?:${[pe,ge,ye].join("|")})${be+me})*`,ve=`(?:${[`${pe}${de}?`,de,ge,ye,fe].join("|")})`,xe=RegExp(`${he}(?=${he})|${ve+we}`,"g");function Ae(e){return le(e)?function(e){return e.match(xe)||[]}(e):function(e){return e.split("")}(e)}function je(e){return t=>{if(!t)return"";const r=le(t)?Ae(t):void 0,n=r?r[0]:t[0],o=r?ae(r,1).join(""):t.slice(1);return n[e]()+o}}const Oe="\\ud800-\\udfff",$e="\\u2700-\\u27bf",Ce="a-z\\xdf-\\xf6\\xf8-\\xff",ke="A-Z\\xc0-\\xd6\\xd8-\\xde",Be="\\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",qe="['’]",Ee=`[${Be}]`,_e=`[${$e}]`,Pe=`[${Ce}]`,Fe=`[^${Oe}${Be+"\\d"+$e+Ce+ke}]`,Se="(?:\\ud83c[\\udde6-\\uddff]){2}",Te="[\\ud800-\\udbff][\\udc00-\\udfff]",Ue=`[${ke}]`,Re=`(?:${Pe}|${Fe})`,Le=`(?:${Ue}|${Fe})`,Ie=`(?:${qe}(?:d|ll|m|re|s|t|ve))?`,Ne=`(?:${qe}(?:D|LL|M|RE|S|T|VE))?`,ze="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff]|\\ud83c[\\udffb-\\udfff])?",Me="[\\ufe0e\\ufe0f]?",De=Me+ze+`(?:\\u200d(?:${[`[^${Oe}]`,Se,Te].join("|")})${Me+ze})*`,Ke=`(?:${[_e,Se,Te].join("|")})${De}`,Ve=RegExp([`${Ue}?${Pe}+${Ie}(?=${[Ee,Ue,"$"].join("|")})`,`${Le}+${Ne}(?=${[Ee,Ue+Re,"$"].join("|")})`,`${Ue}?${Re}+${Ie}`,`${Ue}+${Ne}`,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",Ke].join("|"),"g");const He=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 ]/),We=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Ze(e,t){if(void 0===t){const t=He(e)?function(e){return e.match(Ve)}(e):function(e){return e.match(We)}(e);return t||[]}return e.match(t)||[]}function Qe(e){if(null==e)return"";if("string"==typeof e)return e;if(Array.isArray(e))return`${e.map((e=>null==e?e:Qe(e)))}`;if(R.isSymbol(e))return e.toString();const t=`${e}`;return"0"==t&&1/e==-Infinity?"-0":t}const Ye=je("toUpperCase");je("toLowerCase");var Je=e=>Ze(Qe(e).replace(/['\u2019]/g,"")).reduce(((e,t,r)=>e+(r?"-":"")+t.toLowerCase()),""),Ge=e=>Ze(Qe(e).replace(/['\u2019]/g,"")).reduce(((e,t,r)=>(t=t.toLowerCase(),e+(r?Ye(t):t))),""),Xe=(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},et=e=>{try{if(!e)return"";const t=JSON.parse(e);return JSON.stringify(t,null,2)}catch(t){return e}};const tt=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]=tt(e[r]));return t};const rt=(e,t,r={})=>{const n=e||{},{ignoreUndefined:o=!0,cover:i=!1}=r;if(!t)return n;for(const s in t){if(!t.hasOwnProperty(s))continue;const a=t[s];"object"!=typeof a||"object"!=typeof e[s]||i?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[s]=a):n[s]=nt(e[s],a,r)}return n},nt=(e,t,r={})=>{let n={};return n=e&&"object"==typeof e&&!Array.isArray(e)?rt(e,t,r):rt({...e},t,r),n},ot=(e,t,r={})=>rt({...e},t,{cover:!0,...r}),it=(e,t,r,n,o=!1)=>{if(!e||!t||!r)return;let i=e[t];null!==i&&"object"==typeof i&&o&&Object.keys(i).forEach((e=>{it(i,e,r,n,o)})),Object.defineProperty(e,t,{configurable:!0,enumerable:!0,set:s=>{r.call(n,s,i),i=s,o&&it(e,t,r,n,o)},get:()=>i})};var st={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:i=!0}=t;if((!n||n.length<=0)&&!o)return r;const s={};for(const e in r){if(!r.hasOwnProperty(e))continue;const a=o?i&&e.startsWith("_")?e:Ge(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()||(s[a]=u))}return s},clone:tt,merge:nt,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]=Xe(n,{number:t,boolean:r});else e[n]=Xe(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:ot,combines:(e,t={})=>{let r={};if(!e||e.length<=0)return r;const{ignoreUndefined:n=!0,ignoreNull:o=!0,ignoreZero:i=!0,ignoreEmptyArray:s=!0,ignoreEmptyString:a=!0,cover:u=!0}=t;return e.forEach((e=>r=ot(r,e,{ignoreUndefined:n,ignoreNull:o,ignoreZero:i,ignoreEmptyArray:s,ignoreEmptyString:a,cover:u}))),r},observe:it,find:(e,t)=>{if(e&&"object"==typeof e)return Object.entries(e||{}).find((([e,r])=>!(!t||!t(e,r))))}};class at{__value=void 0;set(e){this.__value=e}get(){return this.__value}}var ut={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 at;return void 0!==e&&t.set(e),t}};var lt={...R,...d,...st,...ut,includes:function(e,t,r,n){e=R.isArrayLike(e)?e:function(e){return e?te(e,function(e){return R.isArrayLike(e)?se(e):function(e){if(!R.isPrototype(e))return oe(e);var t=[];for(var r in Object(e))d.hasOwnProperty.call(e,r)&&"constructor"!=r&&t.push(r);return t}(e)}(e)):[]}(e),r=r&&!n?X.toInteger(r):0;var o=e.length;return r<0&&(r=ie(o+r,0)),R.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,i=r+(n?1:-1);n?i--:++i<o;)if(t(e[i],i,e))return i;return-1}(e,ee,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(R.isObject(e)&&(r=R.isArray(e)?e.entries():Object.entries(e),r))for(const[e,n]of r)t&&t(e,n)}};const ct=function(e,{sep:t="&",eq:r="=",max:n=1e3,multiple:o=!0,uri:i=!0,parseNumber:s=!1,parseBoolean:a=!1}={}){t=t||"&",r=r||"=";const u={};if("string"!=typeof e||0===e.length)return u;const l=/\+/g,c=n||1e3;let f=(e=e.split(t)).length;c>0&&f>c&&(f=c);for(let t=0;t<f;++t){let n,s,a,c,f=e[t].replace(l,"%20"),h=f.indexOf(r);h>=0?(n=f.substr(0,h),s=f.substr(h+1)):(n=f,s=""),a=i?decodeURIComponent(n):n,c=i?decodeURIComponent(s):s,d.hasOwnProperty.call(u,a)&&o?Array.isArray(u[a])?u[a].push(c):u[a]=[u[a],c]:u[a]=c}return st.parseValue(u,{number:s,boolean:a}),u},ft=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},dt=function(e,t=!0){return t?encodeURIComponent(e):e},ht=function(e,{cleanZero:t=!1,cleanNull:r=!1,cleanWhitespace:n=!1}={}){return!(!t||0!==e)||(!(!r||null!=e)||!(!n||"string"!=typeof e||""!==e.trim()))},pt=/^(https?):\/\/([\w.\_\-]+)(?::(\d+))?/,gt=e=>{const t=(e||"").replace(/\\/g,"/").split("?")[0],r=t.match(/[\/]?([\w\_\-]+)[.]?[\w]*[?]?$/),n=r?r[1]:"",o=t.lastIndexOf("/")+1,i=t.substring(o),s=i.lastIndexOf("."),a=i.substring(0,s)||"",u=s>=0?i.substring(s):"";return{route:t.substring(0,o)||"",page:n,name:i,withoutExtension:a,extname:u}},yt=e=>{const t={href:e,url:"",origin:"",protocol:"",host:"",port:"",query:""};if(!e)return t;const r=e.match(pt);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},mt=(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 bt={parse:ct,stringify:function(e,{sep:t="&",eq:r="=",name:n=null,uri:o=!0,cleanZero:i=!1,cleanNull:s=!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=dt(ft(n),o)+r,l=e[n];return Array.isArray(l)?l.map((function(e){return u+dt(ft(e),o)})).join(t):ht(l,{cleanZero:i,cleanNull:s,cleanWhitespace:a})?"":u+dt(ft(l),o)})).filter(Boolean).join(t):n?dt(ft(n),o)+r+dt(ft(e),o):""},https:e=>e?e.replace(/^http[s]?/,"https"):e,parseUrl:e=>{const t=yt(e),{origin:r="",url:n="",query:o=""}=t,i=gt(n),s=ct(o,{multiple:!0,uri:!1});return{...t,...i,pathname:n.substring(n.indexOf(r||"")+r.length),params:s}},parsePath:gt,parseHost:yt,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:mt,isLocalIpAddress:e=>!!e&&!!(mt(e,"127.0.0.1")||mt(e,"localhost")||mt(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]||"",i=n[2]||"";t.host=o;const s=i.split("?");return t.url=t.protocol+`//${t.host}`+s[0],t.file=s[0],t.query=s.length>1?s[1]:"",t.params=ct(t.query,{multiple:!0,uri:!1}),t}};const wt="Expected a function",vt=Math.max,xt=Math.min;function At(e,t=300,r={}){let n,o,i,s,a,u,l=0,c=!1,f=!1,d=!0;if("function"!=typeof e)throw new TypeError(wt);function h(t){const r=n,i=o;return n=o=void 0,l=t,s=e.apply(i,r),s}function p(e){const r=e-u;return void 0===u||r>=t||r<0||f&&e-l>=i}function g(){const e=Date.now();if(p(e))return y(e);a=setTimeout(g,function(e){const r=t-(e-u);return f?xt(r,i-(e-l)):r}(e))}function y(e){return a=void 0,d&&n?h(e):(n=o=void 0,s)}function m(...e){const r=Date.now(),i=p(r);if(n=e,o=this,u=r,i){if(void 0===a)return function(e){return l=e,a=setTimeout(g,t),c?h(e):s}(u);if(f)return a=setTimeout(g,t),h(u)}return void 0===a&&(a=setTimeout(g,t)),s}return t=X.toNumber(t)||0,R.isObject(r)&&(c=!!r.leading,f="maxWait"in r,i=f?vt(X.toNumber(r.maxWait)||0,t):i,d="trailing"in r?!!r.trailing:d),m.cancel=function(){void 0!==a&&clearTimeout(a),l=0,n=u=o=a=void 0},m.flush=function(){return void 0===a?s:y(Date.now())},m.pending=function(){return void 0!==a},m}class jt{__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(R.isFunction(e))r=e(t);else{if(R.isPromise(e))return e.then((e=>({...t,...e})));r=e}return R.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 Ot(e,t,r){return e.then((e=>(r&&r(),[null,e]))).catch((e=>(t&&Object.assign(e,t),r&&r(),[e,void 0])))}const $t=(e,t)=>{try{let r;return r=R.isFunction(e)?e():e,Ot(Promise.resolve(r),void 0,t)}catch(e){return t&&t(),Promise.resolve([e,void 0])}},Ct=e=>"string"==typeof(e="function"==typeof e?e():e)?new Error(e):e;var kt={to:Ot,go:(e,t)=>$t(e,t),delay:(e=1e3)=>new Promise((t=>setTimeout(t,e))),safeRun:$t,toError:Ct,timeout:(e,t=0,r="timeout")=>{if(t<=0)return $t(e);let n;function o(){n&&clearTimeout(n)}const i=new Promise((e=>{o(),n=setTimeout((()=>e([Ct(r||"timeout"),void 0])),t)}));return Promise.race([$t(e,o),i])}};class Bt{_func;_callback;constructor(e,t){this._func=e,this._callback=t}async run(){return kt.safeRun(this._func).then((e=>{try{this._callback&&this._callback(e)}catch(e){console.log("[ddan] task",e)}finally{return e}}))}}class qt{__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 Bt(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 kt.delay(100),this._step()}return this.clear()}}class Et extends(ut.singleton()){__lockedMap=new Map;pipeline=new qt;constructor(){super()}lock(e,t){if(!e||!t)return;const r=kt.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 kt.safeRun(e);const r=this.__lockedMap.get(t);if(r)return r;const n=this.lock(t,e);if(!n)return kt.safeRun(e);const o=await n;return this.unlock(t),o}}function _t(e){return Math.floor(Math.random()*e)}function Pt(e,t=10){return+parseFloat(Number(e).toExponential(t))}const Ft=180/Math.PI;var St={random:_t,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=_t(e);r?n.push(o):n.includes(o)||n.push(o)}return n},strip:Pt,float:function(e,{digits:t=2,fixed:r=!1}={}){const n=Pt(e).toFixed(t);return r||!t?+n:+n.replace(/(\.[1-9]?)0+$/,"$1").replace(/\.$/,"")},radian2degree:function(e){return e*Ft},degree2radian:function(e){return e/Ft},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 Tt={bytes2str:e=>{if(!e||!R.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 i=t[o];r&&Array.isArray(i)?e(i,r,n):n.push(i)}return n}};var Ut={pkcs7Padding:(e,t)=>{const r=t-e.length%t,n=new Uint8Array(r).fill(r);return Tt.concatBytes(e,n)},pkcs7Unpadding:e=>{const t=e[e.length-1];return e.slice(0,-t)}};function Rt(e,t){return e<<t|e>>>32-t}function Lt(e,t){let r,n,o,i,s;return o=2147483648&e,i=2147483648&t,r=1073741824&e,n=1073741824&t,s=(1073741823&e)+(1073741823&t),r&n?2147483648^s^o^i:r|n?1073741824&s?3221225472^s^o^i:1073741824^s^o^i:s^o^i}function It(e,t,r,n,o,i,s){return e=Lt(e,Lt(Lt(function(e,t,r){return e&t|~e&r}(t,r,n),o),s)),Lt(Rt(e,i),t)}function Nt(e,t,r,n,o,i,s){return e=Lt(e,Lt(Lt(function(e,t,r){return e&r|t&~r}(t,r,n),o),s)),Lt(Rt(e,i),t)}function zt(e,t,r,n,o,i,s){return e=Lt(e,Lt(Lt(function(e,t,r){return e^t^r}(t,r,n),o),s)),Lt(Rt(e,i),t)}function Mt(e,t,r,n,o,i,s){return e=Lt(e,Lt(Lt(function(e,t,r){return t^(e|~r)}(t,r,n),o),s)),Lt(Rt(e,i),t)}function Dt(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 Kt(e){let t,r,n,o,i,s,a,u,l,c=[];for(c=function(e){let t;const r=e.length,n=r+8,o=16*((n-n%64)/64+1),i=Array(o-1).fill(0);let s=0,a=0;for(;a<r;)t=(a-a%4)/4,s=a%4*8,i[t]=i[t]|e[a]<<s,a++;return t=(a-a%4)/4,s=a%4*8,i[t]=i[t]|128<<s,i[o-2]=r<<3,i[o-1]=r>>>29,i}(e),s=1732584193,a=4023233417,u=2562383102,l=271733878,t=0;t<c.length;t+=16)r=s,n=a,o=u,i=l,s=It(s,a,u,l,c[t+0],7,3614090360),l=It(l,s,a,u,c[t+1],12,3905402710),u=It(u,l,s,a,c[t+2],17,606105819),a=It(a,u,l,s,c[t+3],22,3250441966),s=It(s,a,u,l,c[t+4],7,4118548399),l=It(l,s,a,u,c[t+5],12,1200080426),u=It(u,l,s,a,c[t+6],17,2821735955),a=It(a,u,l,s,c[t+7],22,4249261313),s=It(s,a,u,l,c[t+8],7,1770035416),l=It(l,s,a,u,c[t+9],12,2336552879),u=It(u,l,s,a,c[t+10],17,4294925233),a=It(a,u,l,s,c[t+11],22,2304563134),s=It(s,a,u,l,c[t+12],7,1804603682),l=It(l,s,a,u,c[t+13],12,4254626195),u=It(u,l,s,a,c[t+14],17,2792965006),a=It(a,u,l,s,c[t+15],22,1236535329),s=Nt(s,a,u,l,c[t+1],5,4129170786),l=Nt(l,s,a,u,c[t+6],9,3225465664),u=Nt(u,l,s,a,c[t+11],14,643717713),a=Nt(a,u,l,s,c[t+0],20,3921069994),s=Nt(s,a,u,l,c[t+5],5,3593408605),l=Nt(l,s,a,u,c[t+10],9,38016083),u=Nt(u,l,s,a,c[t+15],14,3634488961),a=Nt(a,u,l,s,c[t+4],20,3889429448),s=Nt(s,a,u,l,c[t+9],5,568446438),l=Nt(l,s,a,u,c[t+14],9,3275163606),u=Nt(u,l,s,a,c[t+3],14,4107603335),a=Nt(a,u,l,s,c[t+8],20,1163531501),s=Nt(s,a,u,l,c[t+13],5,2850285829),l=Nt(l,s,a,u,c[t+2],9,4243563512),u=Nt(u,l,s,a,c[t+7],14,1735328473),a=Nt(a,u,l,s,c[t+12],20,2368359562),s=zt(s,a,u,l,c[t+5],4,4294588738),l=zt(l,s,a,u,c[t+8],11,2272392833),u=zt(u,l,s,a,c[t+11],16,1839030562),a=zt(a,u,l,s,c[t+14],23,4259657740),s=zt(s,a,u,l,c[t+1],4,2763975236),l=zt(l,s,a,u,c[t+4],11,1272893353),u=zt(u,l,s,a,c[t+7],16,4139469664),a=zt(a,u,l,s,c[t+10],23,3200236656),s=zt(s,a,u,l,c[t+13],4,681279174),l=zt(l,s,a,u,c[t+0],11,3936430074),u=zt(u,l,s,a,c[t+3],16,3572445317),a=zt(a,u,l,s,c[t+6],23,76029189),s=zt(s,a,u,l,c[t+9],4,3654602809),l=zt(l,s,a,u,c[t+12],11,3873151461),u=zt(u,l,s,a,c[t+15],16,530742520),a=zt(a,u,l,s,c[t+2],23,3299628645),s=Mt(s,a,u,l,c[t+0],6,4096336452),l=Mt(l,s,a,u,c[t+7],10,1126891415),u=Mt(u,l,s,a,c[t+14],15,2878612391),a=Mt(a,u,l,s,c[t+5],21,4237533241),s=Mt(s,a,u,l,c[t+12],6,1700485571),l=Mt(l,s,a,u,c[t+3],10,2399980690),u=Mt(u,l,s,a,c[t+10],15,4293915773),a=Mt(a,u,l,s,c[t+1],21,2240044497),s=Mt(s,a,u,l,c[t+8],6,1873313359),l=Mt(l,s,a,u,c[t+15],10,4264355552),u=Mt(u,l,s,a,c[t+6],15,2734768916),a=Mt(a,u,l,s,c[t+13],21,1309151649),s=Mt(s,a,u,l,c[t+4],6,4149444226),l=Mt(l,s,a,u,c[t+11],10,3174756917),u=Mt(u,l,s,a,c[t+2],15,718787259),a=Mt(a,u,l,s,c[t+9],21,3951481745),s=Lt(s,r),a=Lt(a,n),u=Lt(u,o),l=Lt(l,i);return Dt(s)+Dt(a)+Dt(u)+Dt(l)}const Vt=e=>{if("string"!=typeof e&&!(e instanceof Uint8Array))return"";return Kt("string"==typeof e?t.toUtf8Bytes(e):e)};var Ht={md5:Vt,md5Base64:e=>{const t=Vt(e);if(!t)return"";const r=Tt.hex2bytes(t);return I.bytesToBase64(r)}};const Wt=(e,t=!1)=>{const r=new Uint8Array(e);return t?I.bytesToBase64(r):r.reduce(((e,t)=>e+String.fromCharCode(t)),"")};var Zt={...Tt,...Ut,...t,...I,...Ht,str2ab:(e="",t=!1)=>{if(t)return I.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:Wt,utf8ToBase64:e=>R.isBrowser?btoa(e):Buffer.from(e,"utf-8").toString("base64"),base64ToUtf8:e=>R.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]=St.random(256);return t},textEncode:e=>t.toUtf8Bytes(e),textDecode:e=>t.fromUtf8Bytes(new Uint8Array(e)),toDataUrl:(e,t="text/plain")=>e?"string"==typeof e?`data:${t};base64,`+I.toBase64(e):R.isArrayBuffer(e)?`data:${t};base64,`+Wt(e,!0):"":""};const Qt=e=>{try{const t=Zt.ab2str(e,!0);return t.match(/.{1,64}/g)?.join("\n")||""}catch(e){return""}},Yt=(e="",t="PUBLIC KEY")=>`-----BEGIN ${t}-----\n${e}\n-----END ${t}-----`;var Jt={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=Qt(r),o=Yt(n,"PUBLIC KEY"),i=await window.crypto.subtle.exportKey("pkcs8",t.privateKey),s=Qt(i);return{publicKey:n,publicKeyPem:o,privateKey:s,privateKeyPem:Yt(s,"PRIVATE KEY")}}catch(e){return console.error("generateKeys failed:",e),{publicKey:"",publicKeyPem:"",privateKey:"",privateKeyPem:""}}},format_pem_key:Yt,format_pem_content:Qt,encrypt:async(e,t,r)=>{try{const n=(new TextEncoder).encode(t),o=await e.importKey("spki",Zt.str2ab(r,!0),{name:"RSA-OAEP",hash:"SHA-256"},!0,["encrypt"]),i=[];for(let t=0;t<n.length;t+=190){let r=n.slice(t,t+190),s=await e.encrypt({name:"RSA-OAEP"},o,r);i.push(new Uint8Array(s))}const s=Zt.concatBytes(...i);return Zt.bytesToBase64(s)}catch(e){return console.error("[debug] encrypt",e),""}},decrypt:async(e,t,r)=>{try{const n=Zt.base64ToBytes(t),o=await e.importKey("pkcs8",Zt.str2ab(r,!0),{name:"RSA-OAEP",hash:"SHA-256"},!0,["decrypt"]),i=[],s=256;for(let t=0;t<n.length;t+=s){let r=n.slice(t,t+s),a=await e.decrypt({name:"RSA-OAEP"},o,r);i.push(new Uint8Array(a))}const a=Zt.concatBytes(...i);return(new TextDecoder).decode(a)}catch(e){return console.error("decrypt failed:",e),""}}};const Gt=()=>e.webcrypto.subtle;var Xt=async e=>Jt.encrypt(Gt(),e,Jt.RSAPublicKey),er=async e=>Jt.decrypt(Gt(),e,Jt.RSAPrivateKey);const tr="undefined"!=typeof window?window.crypto.subtle:{};var rr=async e=>Jt.encrypt(tr,e,Jt.RSAPublicKey),nr=async e=>Jt.decrypt(tr,e,Jt.RSAPrivateKey);const or=2654435769,ir=(e,t)=>{let r=0;for(let n=0;n<32;n++)r=r+or>>>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},sr=(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-or>>>0;return e},ar=e=>{const t=Zt.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},ur=(e,t)=>{const r=Zt.pkcs7Padding(e,8),n=ar(t),o=[];for(let e=0;e<r.length;e+=8){const t=Zt.bytesToUint32(r.slice(e,e+8)),i=ir(t,n);o.push(Zt.uint32ToBytes(i))}return Zt.concatBytes(...o)},lr=(e,t)=>{const r=ar(t),n=[];for(let t=0;t<e.length;t+=8){const o=Zt.bytesToUint32(e.slice(t,t+8)),i=sr(o,r);n.push(Zt.uint32ToBytes(i))}const o=Zt.concatBytes(...n);return Zt.pkcs7Unpadding(o)};var cr="33576f37387276645054657a6831686e454664424e5652456f47794835795942",fr=(e,t)=>{const r=Zt.textEncode(e),n=ur(r,t);return Zt.bytesToBase64(n)},dr=(e,t)=>{const r=Zt.base64ToBytes(e),n=lr(r,t);return Zt.textDecode(n.buffer)};var hr={logString:e=>{try{const t=JSON.stringify(e);return void 0===t?"":fr(t,Zt.hex2str(cr))}catch(e){return""}},logParse:e=>{try{if(!e)return"";const t=dr(e,Zt.hex2str(cr));return et(t)}catch(e){return""}},logRString:async e=>{try{const t=JSON.stringify(e);if(void 0===t)return"";return R.isBrowser?await rr(t):await Xt(t)}catch(e){return""}},logRParse:async e=>{try{if(!e)return"";const t=R.isBrowser?await nr(e):await er(e);return et(t)}catch(e){return""}}};const pr=(e,t,r)=>e*(1-r)+t*r,gr=(e,t,r)=>e===t?0:(r-e)/(t-e),yr=(e,t,r)=>({x:pr(e.x,t.x,r),y:pr(e.y,t.y,r)}),mr=(e,t,r,n)=>{const o=yr(e,t,n),i=yr(t,r,n);return yr(o,i,n)},br=(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 br(r,t)},wr=(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 vr={bezier1:yr,bezier2:mr,bezier3:(e,t,r,n,o)=>{const i=mr(e,t,r,o),s=mr(t,r,n,o);return yr(i,s,o)},bezier:br,bezierCurve:(e,t)=>{const r=e.length-1;let n=0,o=0;for(let i=0;i<=r;i++){const s=wr(r,i)*Math.pow(1-t,r-i)*Math.pow(t,i);n+=s*e[i].x,o+=s*e[i].y}return{x:n,y:o}},lerp:pr,lerpAverage:(e,t,r="")=>{if(e.length<=0)return 0;if(1===e.length)return e[0].x;if(2===e.length)return pr(e[0].y,e[1].y,.5);const n=[],o=e.slice().sort(((e,t)=>e.x-t.x)),i=o.length,s=o[0].x,a=o[i-1].x;for(let e=s;e<=a;e+=t){let t=0;for(let n=0;n<i-1;n++){const i=o[n],s=o[n+1];if(e>=i.x&&e<=s.x){if("lerp"===r){const r=gr(i.x,s.x,e);t=yr(i,s,r).y}else t=i.y;break}}e>o[i-1].x&&(t=o[i-1].y),n.push(t)}return n.reduce(((e,t)=>e+t),0)/n.length},proportion:gr};var xr={...kt,...hr,...vr,sleep:kt.delay,run:async function(e,t=0){if(t<=0)return kt.safeRun(e);const r=t>0?Date.now():0,n=await kt.safeRun(e),o=Date.now()-r;return o<t&&await kt.delay(t-o),n},exec:(e,t="")=>Et.I.exec(e,t),debounce:At,throttle:function(e,t=300,r={}){let n=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return R.isObject(r)&&(n=r.leading?!!r.leading:n,o=r.trailing?!!r.trailing:o),At(e,t,{leading:n,maxWait:t,trailing:o})},task:e=>new jt(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 i=r<1?100:r;do{if(!t)break;const[e,r]=await kt.to(Promise.resolve(t()));if(e||!1===r)break;o>0&&o--,0!==o&&await kt.delay(i)}while(-1===n||o>0)},pipe:(e,t)=>Et.I.pipeline.push(e,t),pipeline:(e=1)=>new qt(e),safeTask:(e,t)=>new Bt(e,t)};const Ar=/%[sdj%]/g;let jr=()=>{};function Or(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 $r(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(Ar,(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 Cr(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 kr(e,t,r){let n=0;const o=e.length;!function i(s){if(s&&s.length)return void r(s);const a=n;n+=1,a<o?t(e[a],i):r([])}([])}"undefined"!=typeof process&&process.env&&"production"!==process.env.NODE_ENV&&"undefined"!=typeof window&&"undefined"!=typeof document&&(jr=(e,t)=>{"undefined"!=typeof console&&console.warn&&"undefined"==typeof ASYNC_VALIDATOR_NO_WARNING&&t.every((e=>"string"==typeof e))&&console.warn(e,t)});class Br extends Error{errors;fields;constructor(e,t){super("Async Validation Error"),this.errors=e,this.fields=t}}function qr(e,t,r,n,o){if(t.first){const t=new Promise(((t,i)=>{const s=function(e){const t=[];return Object.keys(e).forEach((r=>{t.push(...e[r]||[])})),t}(e);kr(s,r,(e=>(n(e),e.length?i(new Br(e,Or(e))):t(o))))}));return t.catch((e=>e)),t}const i=!0===t.firstFields?Object.keys(e):t.firstFields||[],s=Object.keys(e),a=s.length;let u=0;const l=[],c=new Promise(((t,c)=>{const f=e=>{if(l.push.apply(l,e),u++,u===a)return n(l),l.length?c(new Br(l,Or(l))):t(o)};s.length||(n(l),t(o)),s.forEach((t=>{const n=e[t];-1!==i.indexOf(t)?kr(n,r,f):function(e,t,r){const n=[];let o=0;const i=e.length;function s(e){n.push(...e||[]),o++,o===i&&r(n)}e.forEach((e=>{t(e,s)}))}(n,r,f)}))}));return c.catch((e=>e)),c}function Er(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],(o=r)&&void 0!==o.message?(r.field=r.field||e.fullField,r.fieldValue=n,r):{message:"function"==typeof r?r():r,fieldValue:n,field:r.field||e.fullField};var o}}function _r(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 Pr=(e,t,r,n,o,i)=>{!e.required||r.hasOwnProperty(e.field||"")&&!Cr(t,i||e.type)||n.push($r(o.messages.required,e.fullField))};let Fr;const Sr=/^(([^<>()\[\]\\.,;:\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,}))$/,Tr=/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i,Ur={integer:e=>Ur.number(e)&&parseInt(e,10)===e,float:e=>Ur.number(e)&&!Ur.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&&!Ur.array(e),method:e=>"function"==typeof e,email:e=>"string"==typeof e&&e.length<=320&&!!e.match(Sr),url:e=>"string"==typeof e&&e.length<=2048&&!!e.match((()=>{if(Fr)return Fr;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(),i=new RegExp(`(?:^${r}$)|(?:^${o}$)`),s=new RegExp(`^${r}$`),a=new RegExp(`^${o}$`),u=e=>e&&e.exact?i:new RegExp(`(?:${t(e)}${r}${t(e)})|(?:${t(e)}${o}${t(e)})`,"g");u.v4=e=>e&&e.exact?s:new RegExp(`${t(e)}${r}${t(e)}`,"g"),u.v6=e=>e&&e.exact?a:new RegExp(`${t(e)}${o}${t(e)}`,"g");const l=u.v4().source,c=u.v6().source;return Fr=new RegExp(`(?:^(?:(?:(?:[a-z]+:)?//)|www\\.)(?:\\S+(?::\\S*)?@)?(?:localhost|${l}|${c}|(?:(?:[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"),Fr})()),hex:e=>"string"==typeof e&&!!e.match(Tr)},Rr="enum";var Lr={required:Pr,whitespace:(e,t,r,n,o)=>{(/^\s+$/.test(t)||""===t)&&n.push($r(o.messages.whitespace,e.fullField))},type:(e,t,r,n,o)=>{if(e.required&&void 0===t)return void Pr(e,t,r,n,o);const i=e.type;["integer","float","array","regexp","object","method","email","number","date","url","hex"].indexOf(i)>-1?Ur[i](t)||n.push($r(o.messages.types[i],e.fullField,e.type)):i&&typeof t!==e.type&&n.push($r(o.messages.types[i],e.fullField,e.type))},range:(e,t,r,n,o)=>{const i="number"==typeof e.len,s="number"==typeof e.min,a="number"==typeof e.max,u=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;let l=t,c="";const f="number"==typeof t,d="string"==typeof t,h=Array.isArray(t);if(f?c="number":d?c="string":h&&(c="array"),!c)return!1;h&&(l=t.length),d&&(l=t.replace(u,"_").length),i?l!==e.len&&n.push($r(o.messages[c].len,e.fullField,e.len)):s&&!a&&l<e.min?n.push($r(o.messages[c].min,e.fullField,e.min)):a&&!s&&l>e.max?n.push($r(o.messages[c].max,e.fullField,e.max)):s&&a&&(l<e.min||l>e.max)&&n.push($r(o.messages[c].range,e.fullField,e.min,e.max))},enum:(e,t,r,n,o)=>{e[Rr]=Array.isArray(e[Rr])?e[Rr]:[],-1===e[Rr].indexOf(t)&&n.push($r(o.messages[Rr],e.fullField,e[Rr].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($r(o.messages.pattern.mismatch,e.fullField,t,e.pattern));else if("string"==typeof e.pattern){new RegExp(e.pattern).test(t)||n.push($r(o.messages.pattern.mismatch,e.fullField,t,e.pattern))}}};const Ir=(e,t,r,n,o)=>{const i=e.type,s=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Cr(t,i)&&!e.required)return r();Lr.required(e,t,n,s,o,i),Cr(t,i)||Lr.type(e,t,n,s,o)}r(s)};var Nr={string:(e,t,r,n,o)=>{const i=[];if(e.required||!e.required&&n.hasOwnProperty(e.field||"")){if(Cr(t,"string")&&!e.required)return r();Lr.required(e,t,n,i,o,"string"),Cr(t,"string")||(Lr.type(e,t,n,i,o),Lr.range(e,t,n,i,o),Lr.pattern(e,t,n,i,o),!0===e.whitespace&&Lr.whitespace(e,t,n,i,o))}r(i)},method:(e,t,r,n,o)=>{const i=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Cr(t)&&!e.required)return r();Lr.required(e,t,n,i,o),void 0!==t&&Lr.type(e,t,n,i,o)}r(i)},number:(e,t,r,n,o)=>{const i=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(""===t&&(t=void 0),Cr(t)&&!e.required)return r();Lr.required(e,t,n,i,o),void 0!==t&&(Lr.type(e,t,n,i,o),Lr.range(e,t,n,i,o))}r(i)},boolean:(e,t,r,n,o)=>{const i=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Cr(t)&&!e.required)return r();Lr.required(e,t,n,i,o),void 0!==t&&Lr.type(e,t,n,i,o)}r(i)},regexp:(e,t,r,n,o)=>{const i=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Cr(t)&&!e.required)return r();Lr.required(e,t,n,i,o),Cr(t)||Lr.type(e,t,n,i,o)}r(i)},integer:(e,t,r,n,o)=>{const i=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Cr(t)&&!e.required)return r();Lr.required(e,t,n,i,o),void 0!==t&&(Lr.type(e,t,n,i,o),Lr.range(e,t,n,i,o))}r(i)},float:(e,t,r,n,o)=>{const i=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Cr(t)&&!e.required)return r();Lr.required(e,t,n,i,o),void 0!==t&&(Lr.type(e,t,n,i,o),Lr.range(e,t,n,i,o))}r(i)},array:(e,t,r,n,o)=>{const i=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(null==t&&!e.required)return r();Lr.required(e,t,n,i,o,"array"),null!=t&&(Lr.type(e,t,n,i,o),Lr.range(e,t,n,i,o))}r(i)},object:(e,t,r,n,o)=>{const i=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Cr(t)&&!e.required)return r();Lr.required(e,t,n,i,o),void 0!==t&&Lr.type(e,t,n,i,o)}r(i)},enum:(e,t,r,n,o)=>{const i=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Cr(t)&&!e.required)return r();Lr.required(e,t,n,i,o),void 0!==t&&Lr.enum(e,t,n,i,o)}r(i)},pattern:(e,t,r,n,o)=>{const i=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Cr(t,"string")&&!e.required)return r();Lr.required(e,t,n,i,o),Cr(t,"string")||Lr.pattern(e,t,n,i,o)}r(i)},date:(e,t,r,n,o)=>{const i=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Cr(t,"date")&&!e.required)return r();if(Lr.required(e,t,n,i,o),!Cr(t,"date")){let r;r=t instanceof Date?t:new Date(t),Lr.type(e,r,n,i,o),r&&Lr.range(e,r.getTime(),n,i,o)}}r(i)},url:Ir,hex:Ir,email:Ir,required:(e,t,r,n,o)=>{const i=[],s=Array.isArray(t)?"array":typeof t;Lr.required(e,t,n,i,o,s),r(i)},any:(e,t,r,n,o)=>{const i=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Cr(t)&&!e.required)return r();Lr.required(e,t,n,i,o)}r(i)}};function zr(){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 Mr=zr();class Dr{static register=function(e,t){if("function"!=typeof t)throw new Error("Cannot register a validator by type, validator is not a function");Nr[e]=t};static warning=jr;static messages=Mr;static validators=Nr;rules={};_messages=Mr;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=_r(zr(),e)),this._messages}validate(e,t={},r=(()=>{})){let n=e,o=t,i=r;if("function"==typeof o&&(i=o,o={}),!this.rules||0===Object.keys(this.rules).length)return i&&i(null,n),Promise.resolve(n);if(o.messages){let e=this.messages();e===Mr&&(e=zr()),_r(e,o.messages),o.messages=e}else o.messages=this.messages();const s={};(o.keys||Object.keys(this.rules)).forEach((t=>{const r=this.rules[t];let o=n[t];r.forEach((r=>{let i=r;"function"==typeof i.transform&&(n===e&&(n={...n}),o=n[t]=i.transform(o)),i="function"==typeof i?{validator:i}:{...i},i.validator=this.getValidationMethod(i),i.validator&&(i.field=t,i.fullField=i.fullField||t,i.type=this.getType(i),s[t]=s[t]||[],s[t].push({rule:i,value:o,source:n,field:t}))}))}));const a={};return qr(s,o,((e,t)=>{const r=e.rule;let i,s=!("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 l(i=[]){let l=Array.isArray(i)?i:[i];!0===o.suppressWarning&&l.length&&Dr.warning("async-validator:",l),l.length&&void 0!==r.message&&(l=[].concat(r.message));let c=l.map(Er(r,n));if(o.first&&c.length)return a[r.field]=1,t(c);if(s){if(r.required&&!e.value)return void 0!==r.message?c=[].concat(r.message).map(Er(r,n)):o.error&&(c=[o.error(r,$r(o.messages.required,r.field))]),t(c);let i={};r.defaultField&&Object.keys(e.value).map((e=>{i[e]=r.defaultField})),i={...i,...e.rule.fields};const s={};Object.keys(i).forEach((e=>{const t=i[e],r=Array.isArray(t)?t:[t];s[e]=r.map(u.bind(null,e))}));const a=new Dr(s);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=[];c&&c.length&&r.push(...c),e&&e.length&&r.push(...e),t(r.length?r:null)}))}else t(c)}if(s=s&&(r.required||!r.required&&e.value),r.field=e.field,r.asyncValidator)i=r.asyncValidator(r,e.value,l,e.source,o);else if(r.validator){try{i=r.validator(r,e.value,l,e.source,o)}catch(e){console.error?.(e),o.suppressValidatorError||setTimeout((()=>{throw e}),0),l(e.message)}!0===i?l():!1===i?l("function"==typeof r.message?r.message(r.fullField||r.field):r.message||`${r.fullField||r.field} fails`):i instanceof Array?l(i):i instanceof Error&&l(i.message)}i&&i.then&&i.then((()=>l()),(e=>l(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=Or(t),i(t,r)):i(null,n)}(e)}),n)}getType(e){if(void 0===e.type&&e.pattern instanceof RegExp&&(e.type="pattern"),"function"!=typeof e.validator&&e.type&&!Nr.hasOwnProperty(e.type))throw new Error($r("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]?Nr.required:Nr[this.getType(e)]||void 0}}function Kr(e){return new Dr(e)}var Vr={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:Kr,validate:function(e,t,r={},n=(()=>{})){return xr.run(Kr(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)}};const Hr=e=>{if(!e)return"";if(!lt.isObject(e))return"";let t="";return lt.forof(e,((e,r)=>{r&&(t+=`${Je(e)}:${r};`)})),t},Wr=["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"],Zr=["top","bottom","left","right","padding","margin","marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft","height","width","border","borderLeft","borderRight","borderTop","borderBottom","borderColor","borderRadius"],Qr=(e,t="px")=>e&&t?"0"===e?e:Vr.isFloat(e.toString())?`${e}${t}`:e:e;var Yr={stringify:Hr,parse:(e,{camel:t=!1,pure:r=!0}={})=>{if(!e.trim())return;const n=bt.parse(e,{sep:";",eq:":",uri:!1}),o={};return lt.forof(n,((e,n)=>{if(!n)return;const i=t?r&&e.startsWith("_")?e:Ge(e):e;Vr.isFloat(n)||n.length>=2&&n.startsWith(".")&&Vr.isNumber(n.substr(1))?o[i]=+n:o[i]=n})),o},fixValue:Qr,style:(e,t="px")=>{if(!e)return"";const r=lt.copy(e,{fields:Wr});lt.forof(r,((e,n)=>{(Zr.includes(e)||Zr.includes(Ge(e)))&&(r[e]=Qr(n,t))}));return Hr(r)},commonFields:Wr};var Jr={getDataURL:(e,t)=>{const r={contentType:"",dataUrl:""};return kt.to(fetch(e,{cache:t}).then((e=>(r.contentType=e.headers.get("content-type")||"",e.arrayBuffer()))).then((e=>(r.dataUrl=`data:${r.contentType};base64,`+Zt.ab2str(e,!0),r))))},getArrayBuffer:async(e,t)=>kt.to(fetch(e,{cache:t}).then((e=>e.arrayBuffer()))),getJson:async(e,t)=>kt.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 i=0;const s=[];for(;;){const{done:e,value:r}=await o.read();if(e)break;s.push(r),i+=r.length;const a=St.float(100*i/n,{digits:2});t?.progress&&t?.progress(a,i,n)}const a=new Uint8Array(i);let u=0;for(const e of s)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)=>kt.to(fetch(e,{cache:t}).then((e=>e.text()))),cache:async(e,t="no-cache")=>kt.to(fetch(e,{cache:t}).then((()=>!0)))};const Gr=(e,t="",r=!1)=>{try{if(!e)return;const n=bt.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}?${bt.stringify(t,{uri:!1})}`,i=new XMLHttpRequest;i.open("GET",r,!0),i.responseType="blob",i.onload=function(){Xr(i.response,o)},i.onerror=function(t){console.error(`[ddan] downloadUrl ${e}`,t)},i.send()}}catch(t){console.error(`[ddan] downloadUrl ${e}`,t)}},Xr=(e,t="")=>{try{if(!e)return;const r=URL?.createObjectURL(e);if(!r)return;Gr(r,t),URL?.revokeObjectURL(r)}catch(e){console.error("[ddan] downloadFile",e)}},en=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}},tn=(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)))})),rn=(e,t=!0)=>!(!t||"prompt"!==e)||"granted"===e,nn=(e,t)=>{if(!e||!t)return[];const r=[];let n;for(;null!==(n=t.exec(e));)r.push(n[1]);return r};var on={dataURLtoFile:(e,t)=>{let r=e.split(","),n=r[0].match(/:(.*?);/)[1],o=window.atob(r[1]),i=o.length,s=new Uint8Array(i);for(;i--;)s[i]=o.charCodeAt(i);return new File([s],t,{type:n})},dataURLtoBlob:e=>{let t=e.split(","),r=t[0].match(/:(.*?);/)[1],n=window.atob(t[1]),o=n.length,i=new Uint8Array(o);for(;o--;)i[o]=n.charCodeAt(o);return new Blob([i],{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:Gr,download:(e,t="")=>{e&&("string"!=typeof e?Xr(e,t):Gr(e,t))},downloadFile:Xr,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();Gr(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:i="16px Arial",textAlign:s="left",textBaseline:a="middle"}={})=>{try{if(!e)return"";const u=document.createElement("canvas");u.width=t,u.height=r;const l=u.getContext("2d");return l?(n&&l.rotate(n*Math.PI/180),o&&(l.fillStyle=o),i&&(l.font=i),s&&(l.textAlign=s),a&&(l.textBaseline=a),l.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?tn("clipboard-write").then((t=>{rn(t,!1)?navigator.clipboard.writeText(e).then((()=>r(!0))).catch((()=>r(en(e)))):r(en(e))})).catch((()=>{r(en(e))})):r(en(e))})),queryPermission:tn,isAllowed:rn,legacyCopy:en,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=nn(e,r);t.push(n)})),[].concat(...t)},takeHtml:nn,toBlobUrl:(e,t)=>{const r=new Blob([e],{type:t});return URL.createObjectURL(r)}};class sn{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 an=({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 un(e){const{response:t}=e;return 0===t.code?Promise.resolve(t):Promise.reject(t)}function ln(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(lt.isPlainObject(e)){const r=bt.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 cn{host="";reqConfig={};handleError;interceptors={request:new sn,response:new sn};constructor(e){this.host=e.host||"",this.reqConfig=e.config,this.interceptors.request.use(e.handleRequest||[]),this.interceptors.request.use(ln),this.interceptors.response.use(e.handleResponse||un),this.handleError=e.handleError}static blockId="blockid";static requestLock={};lockR(e,t){cn.requestLock[e]={lock:!0,request:t()}}unlockR(e){delete cn.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=lt.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 i;if(delete o.options.plugins,"block"===r.model)this.lockR(cn.blockId,(()=>an(o))),i=await cn.requestLock[cn.blockId].request;else if(cn.requestLock[cn.blockId]&&cn.requestLock[cn.blockId].lock&&await cn.requestLock[cn.blockId].request,"debounce"===r.model||"debounceUrl"===r.model){let e;e="debounceUrl"===r.model?this.getIdFromReqUrl(o):this.getIdFromReq(o),cn.requestLock[e]||this.lockR(e,(()=>an(o))),i=await cn.requestLock[e].request,this.unlockR(e)}else i=await an(o);return this.interceptors.response.invoke({response:i,config:r,refetch:()=>({sig:"REFETCH",result:this.fetch(e,t)})})}catch(e){return this.handleError&&this.handleError(e),Promise.reject(e)}}}const fn={fetch:Jr,Http:cn,css:Yr,qs:bt,icon:M,html:on};export{fn as default};
|
|
1
|
+
import e from"crypto";var t={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,i=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),i=e.charCodeAt(r+2),t+=String.fromCharCode((15&n)<<12|(63&o)<<6|63&i),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],i=e[r+2];t+=String.fromCharCode((15&n)<<12|(63&o)<<6|63&i),r+=3}}return t}};const r="object"==typeof global&&null!==global&&global.Object===Object&&global,n="object"==typeof globalThis&&null!==globalThis&&globalThis.Object===Object&&globalThis,o="object"==typeof self&&null!==self&&self.Object===Object&&self,i=n||r||o||Function("return this")(),s=i.Symbol,{toString:a,hasOwnProperty:u,propertyIsEnumerable:l}=Object.prototype,c=s?s.toStringTag:void 0;function f(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":c&&c in Object(e)?function(e){const t=u.call(e,c),r=e[c];let n=!1;try{e[c]=void 0,n=!0}catch(e){}const o=a.call(e);return n&&(t?e[c]=r:delete e[c]),o}(e):a.call(e)}var d={getTag:f,getType:function(e){return(f(e).match(/\w+/g)||["object","Undefined"])[1]||""},toString:a,hasOwnProperty:u,propertyIsEnumerable:l};const h="object"==typeof exports&&null!==exports&&!exports.nodeType&&exports,p=h&&"object"==typeof module&&null!==module&&!module.nodeType&&module,g=p&&p.exports===h&&r.process,y=(()=>{try{const e=p&&p.require&&p.require("util").types;return e||g&&g.binding&&g.binding("util")}catch(e){}})();var m="[object Function]",b="[object GeneratorFunction]",w="[object AsyncFunction]",v=9007199254740991;const x=/^(?:0|[1-9]\d*)$/,A=i?.Buffer?.isBuffer,j=/^\[object (?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)Array\]$/,O=y&&y.isTypedArray;function $(e){const t=typeof e;return null!=e&&("object"==t||"function"==t)}function C(e){return null!=e&&"object"==typeof e}const k=Array.isArray;function B(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=v}(e.length)&&!E(e)}function q(e){return C(e)&&B(e)}function E(e){var t=$(e)?d.getTag(e):"";return t===m||t===b||t===w}function _(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Object.prototype)}function P(e){return q(e)&&d.hasOwnProperty.call(e,"callee")&&(!d.propertyIsEnumerable.call(e,"callee")||"[object Arguments]"==d.toString.call(e))}const F="undefined"!=typeof window&&void 0!==window.document,S="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,T=O?e=>O(e):e=>C(e)&&j.test(d.getTag(e)),U="function"==typeof A?A:()=>!1;var R={is:function(e,t){return d.getTag(e)===`[object ${t}]`},isNumber:function(e){return"[object Number]"===d.getTag(e)},isString:function(e){return"string"==typeof e||!k(e)&&C(e)&&"[object String]"==d.getTag(e)},isObject:$,isObjectLike:C,isPlainObject:function(e){if(!C(e)||"[object Object]"!=d.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||C(e)&&"[object Symbol]"===d.getTag(e)},isFunction:E,isArray:k,isArrayLikeObject:q,isIndex:function(e,t){return!!(t=null==t?v:t)&&("number"==typeof e||x.test(e))&&e>-1&&e%1==0&&e<t},isArrayLike:B,isPrototype:_,isArguments:P,isPromise:function(e){return"[object Promise]"===($(e)?d.getTag(e):"")},isBrowser:F,isNode:S,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)||T(e)||P(e)))return!e.length;const t=d.getTag(e);if("[object Map]"===t||"[object Set]"===t)return!e.size;if(_(e))return!Object.keys(e).length;for(const t in e)if(d.hasOwnProperty.call(e,t))return!1;return!0}};const L="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var I={toBase64:(e="")=>{let r,n,o,i,s,a,u,l="",c=0;for(e=t.toUtf8(e);c<e.length;)r=e.charCodeAt(c++),n=e.charCodeAt(c++),o=e.charCodeAt(c++),i=r>>2,s=(3&r)<<4|n>>4,a=(15&n)<<2|o>>6,u=63&o,isNaN(n)?a=u=64:isNaN(o)&&(u=64),l=l+L.charAt(i)+L.charAt(s)+L.charAt(a)+L.charAt(u);return l},fromBase64:(e="")=>{let r,n,o,i,s,a,u,l="",c=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");c<e.length;)i=L.indexOf(e.charAt(c++)),s=L.indexOf(e.charAt(c++)),a=L.indexOf(e.charAt(c++)),u=L.indexOf(e.charAt(c++)),r=i<<2|s>>4,n=(15&s)<<4|a>>2,o=(3&a)<<6|u,l+=String.fromCharCode(r),64!=a&&(l+=String.fromCharCode(n)),64!=u&&(l+=String.fromCharCode(o));return l=t.fromUtf8(l),l},bytesToBase64:e=>{let t,r,n,o,i,s,a,u="",l=0;if(!e||!R.isArrayLike(e)||!R.isUint8Array(e))return"";for(;l<e.length;)t=e[l++],r=e[l++],n=e[l++],o=t>>2,i=(3&t)<<4|r>>4,s=(15&r)<<2|n>>6,a=63&n,isNaN(r)?s=a=64:isNaN(n)&&(a=64),u=u+L.charAt(o)+L.charAt(i)+L.charAt(s)+L.charAt(a);return u},base64ToBytes:(e="")=>{let t,r,n,o,i,s,a,u=[],l=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");l<e.length;)o=L.indexOf(e.charAt(l++)),i=L.indexOf(e.charAt(l++)),s=L.indexOf(e.charAt(l++)),a=L.indexOf(e.charAt(l++)),t=o<<2|i>>4,r=(15&i)<<4|s>>2,n=(3&s)<<6|a,u.push(t),64!=s&&u.push(r),64!=a&&u.push(n);return new Uint8Array(u)}};const N=e=>I.toBase64(e);var z=N;const M=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,${z(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:i=this.__defStyle}=t,s=o&&n?`${n}, url("${e}")`:`url("${e}")`;return`${r}:${s};-webkit-${r}:${s};${i}`}},D=NaN,K=/^\s+|\s+$/g,V=/^[-+]0x[0-9a-f]+$/i,H=/^0b[01]+$/i,W=/^0o[0-7]+$/i,Z=parseInt,Q=1/0,Y=17976931348623157e292;function J(e){if("number"==typeof e)return e;if(R.isSymbol(e))return D;if(R.isObject(e)){const t="function"==typeof e.valueOf?e.valueOf():e;e=R.isObject(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(K,"");const t=H.test(e);return t||W.test(e)?Z(e.slice(2),t?2:8):V.test(e)?D:+e}function G(e){return e?(e=J(e))===Q||e===-Q?(e<0?-1:1)*Y:e==e?e:0:0===e?e:0}var X={toNumber:J,toFinite:G,toInteger:function(e){var t=G(e),r=t%1;return t==t?r?t-r:t:0}};function ee(e){return e!=e}function te(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 re,ne,oe=(re=Object.keys,ne=Object,function(e){return re(ne(e))}),ie=Math.max;function se(e,t){var r=R.isArray(e)||R.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 i in e)!t&&!d.hasOwnProperty.call(e,i)||o&&("length"==i||R.isIndex(i,n))||r.push(i);return r}function ae(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 i=new Array(n);for(;++o<n;)i[o]=e[o+t];return i}(e,t,r)}const ue=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff\\ufe0e\\ufe0f]");function le(e){return ue.test(e)}const ce="\\ud800-\\udfff",fe=`[${ce}]`,de="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff]",he="\\ud83c[\\udffb-\\udfff]",pe=`[^${ce}]`,ge="(?:\\ud83c[\\udde6-\\uddff]){2}",ye="[\\ud800-\\udbff][\\udc00-\\udfff]",me=`${`(?:${de}|${he})`}?`,be="[\\ufe0e\\ufe0f]?",we=be+me+`(?:\\u200d(?:${[pe,ge,ye].join("|")})${be+me})*`,ve=`(?:${[`${pe}${de}?`,de,ge,ye,fe].join("|")})`,xe=RegExp(`${he}(?=${he})|${ve+we}`,"g");function Ae(e){return le(e)?function(e){return e.match(xe)||[]}(e):function(e){return e.split("")}(e)}function je(e){return t=>{if(!t)return"";const r=le(t)?Ae(t):void 0,n=r?r[0]:t[0],o=r?ae(r,1).join(""):t.slice(1);return n[e]()+o}}const Oe="\\ud800-\\udfff",$e="\\u2700-\\u27bf",Ce="a-z\\xdf-\\xf6\\xf8-\\xff",ke="A-Z\\xc0-\\xd6\\xd8-\\xde",Be="\\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",qe="['’]",Ee=`[${Be}]`,_e=`[${$e}]`,Pe=`[${Ce}]`,Fe=`[^${Oe}${Be+"\\d"+$e+Ce+ke}]`,Se="(?:\\ud83c[\\udde6-\\uddff]){2}",Te="[\\ud800-\\udbff][\\udc00-\\udfff]",Ue=`[${ke}]`,Re=`(?:${Pe}|${Fe})`,Le=`(?:${Ue}|${Fe})`,Ie=`(?:${qe}(?:d|ll|m|re|s|t|ve))?`,Ne=`(?:${qe}(?:D|LL|M|RE|S|T|VE))?`,ze="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff]|\\ud83c[\\udffb-\\udfff])?",Me="[\\ufe0e\\ufe0f]?",De=Me+ze+`(?:\\u200d(?:${[`[^${Oe}]`,Se,Te].join("|")})${Me+ze})*`,Ke=`(?:${[_e,Se,Te].join("|")})${De}`,Ve=RegExp([`${Ue}?${Pe}+${Ie}(?=${[Ee,Ue,"$"].join("|")})`,`${Le}+${Ne}(?=${[Ee,Ue+Re,"$"].join("|")})`,`${Ue}?${Re}+${Ie}`,`${Ue}+${Ne}`,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",Ke].join("|"),"g");const He=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 ]/),We=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Ze(e,t){if(void 0===t){const t=He(e)?function(e){return e.match(Ve)}(e):function(e){return e.match(We)}(e);return t||[]}return e.match(t)||[]}function Qe(e){if(null==e)return"";if("string"==typeof e)return e;if(Array.isArray(e))return`${e.map((e=>null==e?e:Qe(e)))}`;if(R.isSymbol(e))return e.toString();const t=`${e}`;return"0"==t&&1/e==-Infinity?"-0":t}const Ye=je("toUpperCase");je("toLowerCase");var Je=e=>Ze(Qe(e).replace(/['\u2019]/g,"")).reduce(((e,t,r)=>e+(r?"-":"")+t.toLowerCase()),""),Ge=e=>Ze(Qe(e).replace(/['\u2019]/g,"")).reduce(((e,t,r)=>(t=t.toLowerCase(),e+(r?Ye(t):t))),""),Xe=(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},et=e=>{try{if(!e)return"";const t=JSON.parse(e);return JSON.stringify(t,null,2)}catch(t){return e}};const tt=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]=tt(e[r]));return t};const rt=(e,t,r={})=>{const n=e||{},{ignoreUndefined:o=!0,cover:i=!1}=r;if(!t)return n;for(const s in t){if(!t.hasOwnProperty(s))continue;const a=t[s];"object"!=typeof a||"object"!=typeof e[s]||i?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[s]=a):n[s]=nt(e[s],a,r)}return n},nt=(e,t,r={})=>{let n={};return n=e&&"object"==typeof e&&!Array.isArray(e)?rt(e,t,r):rt({...e},t,r),n},ot=(e,t,r={})=>rt({...e},t,{cover:!0,...r}),it=(e,t,r,n,o=!1)=>{if(!e||!t||!r)return;let i=e[t];null!==i&&"object"==typeof i&&o&&Object.keys(i).forEach((e=>{it(i,e,r,n,o)})),Object.defineProperty(e,t,{configurable:!0,enumerable:!0,set:s=>{r.call(n,s,i),i=s,o&&it(e,t,r,n,o)},get:()=>i})};var st={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:i=!0}=t;if((!n||n.length<=0)&&!o)return r;const s={};for(const e in r){if(!r.hasOwnProperty(e))continue;const a=o?i&&e.startsWith("_")?e:Ge(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()||(s[a]=u))}return s},clone:tt,merge:nt,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]=Xe(n,{number:t,boolean:r});else e[n]=Xe(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:ot,combines:(e,t={})=>{let r={};if(!e||e.length<=0)return r;const{ignoreUndefined:n=!0,ignoreNull:o=!0,ignoreZero:i=!0,ignoreEmptyArray:s=!0,ignoreEmptyString:a=!0,cover:u=!0}=t;return e.forEach((e=>r=ot(r,e,{ignoreUndefined:n,ignoreNull:o,ignoreZero:i,ignoreEmptyArray:s,ignoreEmptyString:a,cover:u}))),r},observe:it,find:(e,t)=>{if(e&&"object"==typeof e)return Object.entries(e||{}).find((([e,r])=>!(!t||!t(e,r))))}};class at{__value=void 0;set(e){this.__value=e}get(){return this.__value}}var ut={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 at;return void 0!==e&&t.set(e),t}};var lt={...R,...d,...st,...ut,includes:function(e,t,r,n){e=R.isArrayLike(e)?e:function(e){return e?te(e,function(e){return R.isArrayLike(e)?se(e):function(e){if(!R.isPrototype(e))return oe(e);var t=[];for(var r in Object(e))d.hasOwnProperty.call(e,r)&&"constructor"!=r&&t.push(r);return t}(e)}(e)):[]}(e),r=r&&!n?X.toInteger(r):0;var o=e.length;return r<0&&(r=ie(o+r,0)),R.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,i=r+(n?1:-1);n?i--:++i<o;)if(t(e[i],i,e))return i;return-1}(e,ee,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(R.isObject(e)&&(r=R.isArray(e)?e.entries():Object.entries(e),r))for(const[e,n]of r)t&&t(e,n)}};const ct=function(e,{sep:t="&",eq:r="=",max:n=1e3,multiple:o=!0,uri:i=!0,parseNumber:s=!1,parseBoolean:a=!1}={}){t=t||"&",r=r||"=";const u={};if("string"!=typeof e||0===e.length)return u;const l=/\+/g,c=n||1e3;let f=(e=e.split(t)).length;c>0&&f>c&&(f=c);for(let t=0;t<f;++t){let n,s,a,c,f=e[t].replace(l,"%20"),h=f.indexOf(r);h>=0?(n=f.substr(0,h),s=f.substr(h+1)):(n=f,s=""),a=i?decodeURIComponent(n):n,c=i?decodeURIComponent(s):s,d.hasOwnProperty.call(u,a)&&o?Array.isArray(u[a])?u[a].push(c):u[a]=[u[a],c]:u[a]=c}return st.parseValue(u,{number:s,boolean:a}),u},ft=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},dt=function(e,t=!0){return t?encodeURIComponent(e):e},ht=function(e,{cleanZero:t=!1,cleanNull:r=!1,cleanWhitespace:n=!1}={}){return!(!t||0!==e)||(!(!r||null!=e)||!(!n||"string"!=typeof e||""!==e.trim()))},pt=/^(https?):\/\/([\w.\_\-]+)(?::(\d+))?/,gt=e=>{const t=(e||"").replace(/\\/g,"/").split("?")[0],r=t.match(/[\/]?([\w\_\-]+)[.]?[\w]*[?]?$/),n=r?r[1]:"",o=t.lastIndexOf("/")+1,i=t.substring(o),s=i.lastIndexOf("."),a=i.substring(0,s)||"",u=s>=0?i.substring(s):"";return{route:t.substring(0,o)||"",page:n,name:i,withoutExtension:a,extname:u}},yt=e=>{const t={href:e,url:"",origin:"",protocol:"",host:"",port:"",query:""};if(!e)return t;const r=e.match(pt);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},mt=(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 bt={parse:ct,stringify:function(e,{sep:t="&",eq:r="=",name:n=null,uri:o=!0,cleanZero:i=!1,cleanNull:s=!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=dt(ft(n),o)+r,l=e[n];return Array.isArray(l)?l.map((function(e){return u+dt(ft(e),o)})).join(t):ht(l,{cleanZero:i,cleanNull:s,cleanWhitespace:a})?"":u+dt(ft(l),o)})).filter(Boolean).join(t):n?dt(ft(n),o)+r+dt(ft(e),o):""},https:e=>e?e.replace(/^http[s]?/,"https"):e,parseUrl:e=>{const t=yt(e),{origin:r="",url:n="",query:o=""}=t,i=gt(n),s=ct(o,{multiple:!0,uri:!1});return{...t,...i,pathname:n.substring(n.indexOf(r||"")+r.length),params:s}},parsePath:gt,parseHost:yt,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:mt,isLocalIpAddress:e=>!!e&&!!(mt(e,"127.0.0.1")||mt(e,"localhost")||mt(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]||"",i=n[2]||"";t.host=o;const s=i.split("?");return t.url=t.protocol+`//${t.host}`+s[0],t.file=s[0],t.query=s.length>1?s[1]:"",t.params=ct(t.query,{multiple:!0,uri:!1}),t}};const wt="Expected a function",vt=Math.max,xt=Math.min;function At(e,t=300,r={}){let n,o,i,s,a,u,l=0,c=!1,f=!1,d=!0;if("function"!=typeof e)throw new TypeError(wt);function h(t){const r=n,i=o;return n=o=void 0,l=t,s=e.apply(i,r),s}function p(e){const r=e-u;return void 0===u||r>=t||r<0||f&&e-l>=i}function g(){const e=Date.now();if(p(e))return y(e);a=setTimeout(g,function(e){const r=t-(e-u);return f?xt(r,i-(e-l)):r}(e))}function y(e){return a=void 0,d&&n?h(e):(n=o=void 0,s)}function m(...e){const r=Date.now(),i=p(r);if(n=e,o=this,u=r,i){if(void 0===a)return function(e){return l=e,a=setTimeout(g,t),c?h(e):s}(u);if(f)return a=setTimeout(g,t),h(u)}return void 0===a&&(a=setTimeout(g,t)),s}return t=X.toNumber(t)||0,R.isObject(r)&&(c=!!r.leading,f="maxWait"in r,i=f?vt(X.toNumber(r.maxWait)||0,t):i,d="trailing"in r?!!r.trailing:d),m.cancel=function(){void 0!==a&&clearTimeout(a),l=0,n=u=o=a=void 0},m.flush=function(){return void 0===a?s:y(Date.now())},m.pending=function(){return void 0!==a},m}class jt{__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(R.isFunction(e))r=e(t);else{if(R.isPromise(e))return e.then((e=>({...t,...e})));r=e}return R.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 Ot(e,t,r){return e.then((e=>(r&&r(),[null,e]))).catch((e=>(t&&Object.assign(e,t),r&&r(),[e,void 0])))}const $t=(e,t)=>{try{let r;return r=R.isFunction(e)?e():e,Ot(Promise.resolve(r),void 0,t)}catch(e){return t&&t(),Promise.resolve([e,void 0])}},Ct=e=>"string"==typeof(e="function"==typeof e?e():e)?new Error(e):e;var kt={to:Ot,go:(e,t)=>$t(e,t),delay:(e=1e3)=>new Promise((t=>setTimeout(t,e))),safeRun:$t,toError:Ct,timeout:(e,t=0,r="timeout")=>{if(t<=0)return $t(e);let n;function o(){n&&clearTimeout(n)}const i=new Promise((e=>{o(),n=setTimeout((()=>e([Ct(r||"timeout"),void 0])),t)}));return Promise.race([$t(e,o),i])}};class Bt{_func;_callback;constructor(e,t){this._func=e,this._callback=t}async run(){return kt.safeRun(this._func).then((e=>{try{this._callback&&this._callback(e)}catch(e){console.log("[ddan] task",e)}finally{return e}}))}}class qt{__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 Bt(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 kt.delay(100),this._step()}return this.clear()}}class Et extends(ut.singleton()){__lockedMap=new Map;pipeline=new qt;constructor(){super()}lock(e,t){if(!e||!t)return;const r=kt.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 kt.safeRun(e);const r=this.__lockedMap.get(t);if(r)return r;const n=this.lock(t,e);if(!n)return kt.safeRun(e);const o=await n;return this.unlock(t),o}}function _t(e){return Math.floor(Math.random()*e)}function Pt(e,t=10){return+parseFloat(Number(e).toExponential(t))}const Ft=180/Math.PI;var St={random:_t,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=_t(e);r?n.push(o):n.includes(o)||n.push(o)}return n},strip:Pt,float:function(e,{digits:t=2,fixed:r=!1}={}){const n=Pt(e).toFixed(t);return r||!t?+n:+n.replace(/(\.[1-9]?)0+$/,"$1").replace(/\.$/,"")},radian2degree:function(e){return e*Ft},degree2radian:function(e){return e/Ft},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 Tt={bytes2str:e=>{if(!e||!R.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 i=t[o];r&&Array.isArray(i)?e(i,r,n):n.push(i)}return n}};var Ut={pkcs7Padding:(e,t)=>{const r=t-e.length%t,n=new Uint8Array(r).fill(r);return Tt.concatBytes(e,n)},pkcs7Unpadding:e=>{const t=e[e.length-1];return e.slice(0,-t)}};function Rt(e,t){return e<<t|e>>>32-t}function Lt(e,t){let r,n,o,i,s;return o=2147483648&e,i=2147483648&t,r=1073741824&e,n=1073741824&t,s=(1073741823&e)+(1073741823&t),r&n?2147483648^s^o^i:r|n?1073741824&s?3221225472^s^o^i:1073741824^s^o^i:s^o^i}function It(e,t,r,n,o,i,s){return e=Lt(e,Lt(Lt(function(e,t,r){return e&t|~e&r}(t,r,n),o),s)),Lt(Rt(e,i),t)}function Nt(e,t,r,n,o,i,s){return e=Lt(e,Lt(Lt(function(e,t,r){return e&r|t&~r}(t,r,n),o),s)),Lt(Rt(e,i),t)}function zt(e,t,r,n,o,i,s){return e=Lt(e,Lt(Lt(function(e,t,r){return e^t^r}(t,r,n),o),s)),Lt(Rt(e,i),t)}function Mt(e,t,r,n,o,i,s){return e=Lt(e,Lt(Lt(function(e,t,r){return t^(e|~r)}(t,r,n),o),s)),Lt(Rt(e,i),t)}function Dt(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 Kt(e){let t,r,n,o,i,s,a,u,l,c=[];for(c=function(e){let t;const r=e.length,n=r+8,o=16*((n-n%64)/64+1),i=Array(o-1).fill(0);let s=0,a=0;for(;a<r;)t=(a-a%4)/4,s=a%4*8,i[t]=i[t]|e[a]<<s,a++;return t=(a-a%4)/4,s=a%4*8,i[t]=i[t]|128<<s,i[o-2]=r<<3,i[o-1]=r>>>29,i}(e),s=1732584193,a=4023233417,u=2562383102,l=271733878,t=0;t<c.length;t+=16)r=s,n=a,o=u,i=l,s=It(s,a,u,l,c[t+0],7,3614090360),l=It(l,s,a,u,c[t+1],12,3905402710),u=It(u,l,s,a,c[t+2],17,606105819),a=It(a,u,l,s,c[t+3],22,3250441966),s=It(s,a,u,l,c[t+4],7,4118548399),l=It(l,s,a,u,c[t+5],12,1200080426),u=It(u,l,s,a,c[t+6],17,2821735955),a=It(a,u,l,s,c[t+7],22,4249261313),s=It(s,a,u,l,c[t+8],7,1770035416),l=It(l,s,a,u,c[t+9],12,2336552879),u=It(u,l,s,a,c[t+10],17,4294925233),a=It(a,u,l,s,c[t+11],22,2304563134),s=It(s,a,u,l,c[t+12],7,1804603682),l=It(l,s,a,u,c[t+13],12,4254626195),u=It(u,l,s,a,c[t+14],17,2792965006),a=It(a,u,l,s,c[t+15],22,1236535329),s=Nt(s,a,u,l,c[t+1],5,4129170786),l=Nt(l,s,a,u,c[t+6],9,3225465664),u=Nt(u,l,s,a,c[t+11],14,643717713),a=Nt(a,u,l,s,c[t+0],20,3921069994),s=Nt(s,a,u,l,c[t+5],5,3593408605),l=Nt(l,s,a,u,c[t+10],9,38016083),u=Nt(u,l,s,a,c[t+15],14,3634488961),a=Nt(a,u,l,s,c[t+4],20,3889429448),s=Nt(s,a,u,l,c[t+9],5,568446438),l=Nt(l,s,a,u,c[t+14],9,3275163606),u=Nt(u,l,s,a,c[t+3],14,4107603335),a=Nt(a,u,l,s,c[t+8],20,1163531501),s=Nt(s,a,u,l,c[t+13],5,2850285829),l=Nt(l,s,a,u,c[t+2],9,4243563512),u=Nt(u,l,s,a,c[t+7],14,1735328473),a=Nt(a,u,l,s,c[t+12],20,2368359562),s=zt(s,a,u,l,c[t+5],4,4294588738),l=zt(l,s,a,u,c[t+8],11,2272392833),u=zt(u,l,s,a,c[t+11],16,1839030562),a=zt(a,u,l,s,c[t+14],23,4259657740),s=zt(s,a,u,l,c[t+1],4,2763975236),l=zt(l,s,a,u,c[t+4],11,1272893353),u=zt(u,l,s,a,c[t+7],16,4139469664),a=zt(a,u,l,s,c[t+10],23,3200236656),s=zt(s,a,u,l,c[t+13],4,681279174),l=zt(l,s,a,u,c[t+0],11,3936430074),u=zt(u,l,s,a,c[t+3],16,3572445317),a=zt(a,u,l,s,c[t+6],23,76029189),s=zt(s,a,u,l,c[t+9],4,3654602809),l=zt(l,s,a,u,c[t+12],11,3873151461),u=zt(u,l,s,a,c[t+15],16,530742520),a=zt(a,u,l,s,c[t+2],23,3299628645),s=Mt(s,a,u,l,c[t+0],6,4096336452),l=Mt(l,s,a,u,c[t+7],10,1126891415),u=Mt(u,l,s,a,c[t+14],15,2878612391),a=Mt(a,u,l,s,c[t+5],21,4237533241),s=Mt(s,a,u,l,c[t+12],6,1700485571),l=Mt(l,s,a,u,c[t+3],10,2399980690),u=Mt(u,l,s,a,c[t+10],15,4293915773),a=Mt(a,u,l,s,c[t+1],21,2240044497),s=Mt(s,a,u,l,c[t+8],6,1873313359),l=Mt(l,s,a,u,c[t+15],10,4264355552),u=Mt(u,l,s,a,c[t+6],15,2734768916),a=Mt(a,u,l,s,c[t+13],21,1309151649),s=Mt(s,a,u,l,c[t+4],6,4149444226),l=Mt(l,s,a,u,c[t+11],10,3174756917),u=Mt(u,l,s,a,c[t+2],15,718787259),a=Mt(a,u,l,s,c[t+9],21,3951481745),s=Lt(s,r),a=Lt(a,n),u=Lt(u,o),l=Lt(l,i);return Dt(s)+Dt(a)+Dt(u)+Dt(l)}const Vt=e=>{if("string"!=typeof e&&!(e instanceof Uint8Array))return"";return Kt("string"==typeof e?t.toUtf8Bytes(e):e)};var Ht={md5:Vt,md5Base64:e=>{const t=Vt(e);if(!t)return"";const r=Tt.hex2bytes(t);return I.bytesToBase64(r)}};const Wt=(e,t=!1)=>{const r=new Uint8Array(e);return t?I.bytesToBase64(r):r.reduce(((e,t)=>e+String.fromCharCode(t)),"")};var Zt={...Tt,...Ut,...t,...I,...Ht,str2ab:(e="",t=!1)=>{if(t)return I.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:Wt,utf8ToBase64:e=>R.isBrowser?btoa(e):Buffer.from(e,"utf-8").toString("base64"),base64ToUtf8:e=>R.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]=St.random(256);return t},textEncode:e=>t.toUtf8Bytes(e),textDecode:e=>t.fromUtf8Bytes(new Uint8Array(e)),toDataUrl:(e,t="text/plain")=>e?"string"==typeof e?`data:${t};base64,`+I.toBase64(e):R.isArrayBuffer(e)?`data:${t};base64,`+Wt(e,!0):"":""};const Qt=e=>{try{const t=Zt.ab2str(e,!0);return t.match(/.{1,64}/g)?.join("\n")||""}catch(e){return""}},Yt=(e="",t="PUBLIC KEY")=>`-----BEGIN ${t}-----\n${e}\n-----END ${t}-----`;var Jt={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=Qt(r),o=Yt(n,"PUBLIC KEY"),i=await window.crypto.subtle.exportKey("pkcs8",t.privateKey),s=Qt(i);return{publicKey:n,publicKeyPem:o,privateKey:s,privateKeyPem:Yt(s,"PRIVATE KEY")}}catch(e){return console.error("generateKeys failed:",e),{publicKey:"",publicKeyPem:"",privateKey:"",privateKeyPem:""}}},format_pem_key:Yt,format_pem_content:Qt,encrypt:async(e,t,r)=>{try{const n=(new TextEncoder).encode(t),o=await e.importKey("spki",Zt.str2ab(r,!0),{name:"RSA-OAEP",hash:"SHA-256"},!0,["encrypt"]),i=[];for(let t=0;t<n.length;t+=190){let r=n.slice(t,t+190),s=await e.encrypt({name:"RSA-OAEP"},o,r);i.push(new Uint8Array(s))}const s=Zt.concatBytes(...i);return Zt.bytesToBase64(s)}catch(e){return console.error("[debug] encrypt",e),""}},decrypt:async(e,t,r)=>{try{const n=Zt.base64ToBytes(t),o=await e.importKey("pkcs8",Zt.str2ab(r,!0),{name:"RSA-OAEP",hash:"SHA-256"},!0,["decrypt"]),i=[],s=256;for(let t=0;t<n.length;t+=s){let r=n.slice(t,t+s),a=await e.decrypt({name:"RSA-OAEP"},o,r);i.push(new Uint8Array(a))}const a=Zt.concatBytes(...i);return(new TextDecoder).decode(a)}catch(e){return console.error("decrypt failed:",e),""}}};const Gt=()=>e.webcrypto.subtle;var Xt=async e=>Jt.encrypt(Gt(),e,Jt.RSAPublicKey),er=async e=>Jt.decrypt(Gt(),e,Jt.RSAPrivateKey);const tr="undefined"!=typeof window?window.crypto.subtle:{};var rr=async e=>Jt.encrypt(tr,e,Jt.RSAPublicKey),nr=async e=>Jt.decrypt(tr,e,Jt.RSAPrivateKey);const or=2654435769,ir=(e,t)=>{let r=0;for(let n=0;n<32;n++)r=r+or>>>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},sr=(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-or>>>0;return e},ar=e=>{const t=Zt.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},ur=(e,t)=>{const r=Zt.pkcs7Padding(e,8),n=ar(t),o=[];for(let e=0;e<r.length;e+=8){const t=Zt.bytesToUint32(r.slice(e,e+8)),i=ir(t,n);o.push(Zt.uint32ToBytes(i))}return Zt.concatBytes(...o)},lr=(e,t)=>{const r=ar(t),n=[];for(let t=0;t<e.length;t+=8){const o=Zt.bytesToUint32(e.slice(t,t+8)),i=sr(o,r);n.push(Zt.uint32ToBytes(i))}const o=Zt.concatBytes(...n);return Zt.pkcs7Unpadding(o)};var cr="33576f37387276645054657a6831686e454664424e5652456f47794835795942",fr=(e,t)=>{const r=Zt.textEncode(e),n=ur(r,t);return Zt.bytesToBase64(n)},dr=(e,t)=>{const r=Zt.base64ToBytes(e),n=lr(r,t);return Zt.textDecode(n.buffer)};var hr={logString:e=>{try{const t=JSON.stringify(e);return void 0===t?"":fr(t,Zt.hex2str(cr))}catch(e){return""}},logParse:e=>{try{if(!e)return"";const t=dr(e,Zt.hex2str(cr));return et(t)}catch(e){return""}},logRString:async e=>{try{const t=JSON.stringify(e);if(void 0===t)return"";return R.isBrowser?await rr(t):await Xt(t)}catch(e){return""}},logRParse:async e=>{try{if(!e)return"";const t=R.isBrowser?await nr(e):await er(e);return et(t)}catch(e){return""}}};const pr=(e,t,r)=>e*(1-r)+t*r,gr=(e,t,r)=>e===t?0:(r-e)/(t-e),yr=(e,t,r)=>({x:pr(e.x,t.x,r),y:pr(e.y,t.y,r)}),mr=(e,t,r,n)=>{const o=yr(e,t,n),i=yr(t,r,n);return yr(o,i,n)},br=(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 br(r,t)},wr=(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 vr={bezier1:yr,bezier2:mr,bezier3:(e,t,r,n,o)=>{const i=mr(e,t,r,o),s=mr(t,r,n,o);return yr(i,s,o)},bezier:br,bezierCurve:(e,t)=>{const r=e.length-1;let n=0,o=0;for(let i=0;i<=r;i++){const s=wr(r,i)*Math.pow(1-t,r-i)*Math.pow(t,i);n+=s*e[i].x,o+=s*e[i].y}return{x:n,y:o}},lerp:pr,lerpAverage:(e,t,r="")=>{if(e.length<=0)return 0;if(1===e.length)return e[0].x;if(2===e.length)return pr(e[0].y,e[1].y,.5);const n=[],o=e.slice().sort(((e,t)=>e.x-t.x)),i=o.length,s=o[0].x,a=o[i-1].x;for(let e=s;e<=a;e+=t){let t=0;for(let n=0;n<i-1;n++){const i=o[n],s=o[n+1];if(e>=i.x&&e<=s.x){if("lerp"===r){const r=gr(i.x,s.x,e);t=yr(i,s,r).y}else t=i.y;break}}e>o[i-1].x&&(t=o[i-1].y),n.push(t)}return n.reduce(((e,t)=>e+t),0)/n.length},proportion:gr};var xr={...kt,...hr,...vr,sleep:kt.delay,run:async function(e,t=0){if(t<=0)return kt.safeRun(e);const r=t>0?Date.now():0,n=await kt.safeRun(e),o=Date.now()-r;return o<t&&await kt.delay(t-o),n},exec:(e,t="")=>Et.I.exec(e,t),debounce:At,throttle:function(e,t=300,r={}){let n=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return R.isObject(r)&&(n=r.leading?!!r.leading:n,o=r.trailing?!!r.trailing:o),At(e,t,{leading:n,maxWait:t,trailing:o})},task:e=>new jt(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 i=r<1?100:r;do{if(!t)break;const[e,r]=await kt.to(Promise.resolve(t()));if(e||!1===r)break;o>0&&o--,0!==o&&await kt.delay(i)}while(-1===n||o>0)},pipe:(e,t)=>Et.I.pipeline.push(e,t),pipeline:(e=1)=>new qt(e),safeTask:(e,t)=>new Bt(e,t)};const Ar=/%[sdj%]/g;let jr=()=>{};function Or(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 $r(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(Ar,(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 Cr(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 kr(e,t,r){let n=0;const o=e.length;!function i(s){if(s&&s.length)return void r(s);const a=n;n+=1,a<o?t(e[a],i):r([])}([])}"undefined"!=typeof process&&process.env&&"production"!==process.env.NODE_ENV&&"undefined"!=typeof window&&"undefined"!=typeof document&&(jr=(e,t)=>{"undefined"!=typeof console&&console.warn&&"undefined"==typeof ASYNC_VALIDATOR_NO_WARNING&&t.every((e=>"string"==typeof e))&&console.warn(e,t)});class Br extends Error{errors;fields;constructor(e,t){super("Async Validation Error"),this.errors=e,this.fields=t}}function qr(e,t,r,n,o){if(t.first){const t=new Promise(((t,i)=>{const s=function(e){const t=[];return Object.keys(e).forEach((r=>{t.push(...e[r]||[])})),t}(e);kr(s,r,(e=>(n(e),e.length?i(new Br(e,Or(e))):t(o))))}));return t.catch((e=>e)),t}const i=!0===t.firstFields?Object.keys(e):t.firstFields||[],s=Object.keys(e),a=s.length;let u=0;const l=[],c=new Promise(((t,c)=>{const f=e=>{if(l.push.apply(l,e),u++,u===a)return n(l),l.length?c(new Br(l,Or(l))):t(o)};s.length||(n(l),t(o)),s.forEach((t=>{const n=e[t];-1!==i.indexOf(t)?kr(n,r,f):function(e,t,r){const n=[];let o=0;const i=e.length;function s(e){n.push(...e||[]),o++,o===i&&r(n)}e.forEach((e=>{t(e,s)}))}(n,r,f)}))}));return c.catch((e=>e)),c}function Er(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],(o=r)&&void 0!==o.message?(r.field=r.field||e.fullField,r.fieldValue=n,r):{message:"function"==typeof r?r():r,fieldValue:n,field:r.field||e.fullField};var o}}function _r(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 Pr=(e,t,r,n,o,i)=>{!e.required||r.hasOwnProperty(e.field||"")&&!Cr(t,i||e.type)||n.push($r(o.messages.required,e.fullField))};let Fr;const Sr=/^(([^<>()\[\]\\.,;:\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,}))$/,Tr=/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i,Ur={integer:e=>Ur.number(e)&&parseInt(e,10)===e,float:e=>Ur.number(e)&&!Ur.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&&!Ur.array(e),method:e=>"function"==typeof e,email:e=>"string"==typeof e&&e.length<=320&&!!e.match(Sr),url:e=>"string"==typeof e&&e.length<=2048&&!!e.match((()=>{if(Fr)return Fr;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(),i=new RegExp(`(?:^${r}$)|(?:^${o}$)`),s=new RegExp(`^${r}$`),a=new RegExp(`^${o}$`),u=e=>e&&e.exact?i:new RegExp(`(?:${t(e)}${r}${t(e)})|(?:${t(e)}${o}${t(e)})`,"g");u.v4=e=>e&&e.exact?s:new RegExp(`${t(e)}${r}${t(e)}`,"g"),u.v6=e=>e&&e.exact?a:new RegExp(`${t(e)}${o}${t(e)}`,"g");const l=u.v4().source,c=u.v6().source;return Fr=new RegExp(`(?:^(?:(?:(?:[a-z]+:)?//)|www\\.)(?:\\S+(?::\\S*)?@)?(?:localhost|${l}|${c}|(?:(?:[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"),Fr})()),hex:e=>"string"==typeof e&&!!e.match(Tr)},Rr="enum";var Lr={required:Pr,whitespace:(e,t,r,n,o)=>{(/^\s+$/.test(t)||""===t)&&n.push($r(o.messages.whitespace,e.fullField))},type:(e,t,r,n,o)=>{if(e.required&&void 0===t)return void Pr(e,t,r,n,o);const i=e.type;["integer","float","array","regexp","object","method","email","number","date","url","hex"].indexOf(i)>-1?Ur[i](t)||n.push($r(o.messages.types[i],e.fullField,e.type)):i&&typeof t!==e.type&&n.push($r(o.messages.types[i],e.fullField,e.type))},range:(e,t,r,n,o)=>{const i="number"==typeof e.len,s="number"==typeof e.min,a="number"==typeof e.max,u=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;let l=t,c="";const f="number"==typeof t,d="string"==typeof t,h=Array.isArray(t);if(f?c="number":d?c="string":h&&(c="array"),!c)return!1;h&&(l=t.length),d&&(l=t.replace(u,"_").length),i?l!==e.len&&n.push($r(o.messages[c].len,e.fullField,e.len)):s&&!a&&l<e.min?n.push($r(o.messages[c].min,e.fullField,e.min)):a&&!s&&l>e.max?n.push($r(o.messages[c].max,e.fullField,e.max)):s&&a&&(l<e.min||l>e.max)&&n.push($r(o.messages[c].range,e.fullField,e.min,e.max))},enum:(e,t,r,n,o)=>{e[Rr]=Array.isArray(e[Rr])?e[Rr]:[],-1===e[Rr].indexOf(t)&&n.push($r(o.messages[Rr],e.fullField,e[Rr].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($r(o.messages.pattern.mismatch,e.fullField,t,e.pattern));else if("string"==typeof e.pattern){new RegExp(e.pattern).test(t)||n.push($r(o.messages.pattern.mismatch,e.fullField,t,e.pattern))}}};const Ir=(e,t,r,n,o)=>{const i=e.type,s=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Cr(t,i)&&!e.required)return r();Lr.required(e,t,n,s,o,i),Cr(t,i)||Lr.type(e,t,n,s,o)}r(s)};var Nr={string:(e,t,r,n,o)=>{const i=[];if(e.required||!e.required&&n.hasOwnProperty(e.field||"")){if(Cr(t,"string")&&!e.required)return r();Lr.required(e,t,n,i,o,"string"),Cr(t,"string")||(Lr.type(e,t,n,i,o),Lr.range(e,t,n,i,o),Lr.pattern(e,t,n,i,o),!0===e.whitespace&&Lr.whitespace(e,t,n,i,o))}r(i)},method:(e,t,r,n,o)=>{const i=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Cr(t)&&!e.required)return r();Lr.required(e,t,n,i,o),void 0!==t&&Lr.type(e,t,n,i,o)}r(i)},number:(e,t,r,n,o)=>{const i=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(""===t&&(t=void 0),Cr(t)&&!e.required)return r();Lr.required(e,t,n,i,o),void 0!==t&&(Lr.type(e,t,n,i,o),Lr.range(e,t,n,i,o))}r(i)},boolean:(e,t,r,n,o)=>{const i=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Cr(t)&&!e.required)return r();Lr.required(e,t,n,i,o),void 0!==t&&Lr.type(e,t,n,i,o)}r(i)},regexp:(e,t,r,n,o)=>{const i=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Cr(t)&&!e.required)return r();Lr.required(e,t,n,i,o),Cr(t)||Lr.type(e,t,n,i,o)}r(i)},integer:(e,t,r,n,o)=>{const i=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Cr(t)&&!e.required)return r();Lr.required(e,t,n,i,o),void 0!==t&&(Lr.type(e,t,n,i,o),Lr.range(e,t,n,i,o))}r(i)},float:(e,t,r,n,o)=>{const i=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Cr(t)&&!e.required)return r();Lr.required(e,t,n,i,o),void 0!==t&&(Lr.type(e,t,n,i,o),Lr.range(e,t,n,i,o))}r(i)},array:(e,t,r,n,o)=>{const i=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(null==t&&!e.required)return r();Lr.required(e,t,n,i,o,"array"),null!=t&&(Lr.type(e,t,n,i,o),Lr.range(e,t,n,i,o))}r(i)},object:(e,t,r,n,o)=>{const i=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Cr(t)&&!e.required)return r();Lr.required(e,t,n,i,o),void 0!==t&&Lr.type(e,t,n,i,o)}r(i)},enum:(e,t,r,n,o)=>{const i=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Cr(t)&&!e.required)return r();Lr.required(e,t,n,i,o),void 0!==t&&Lr.enum(e,t,n,i,o)}r(i)},pattern:(e,t,r,n,o)=>{const i=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Cr(t,"string")&&!e.required)return r();Lr.required(e,t,n,i,o),Cr(t,"string")||Lr.pattern(e,t,n,i,o)}r(i)},date:(e,t,r,n,o)=>{const i=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Cr(t,"date")&&!e.required)return r();if(Lr.required(e,t,n,i,o),!Cr(t,"date")){let r;r=t instanceof Date?t:new Date(t),Lr.type(e,r,n,i,o),r&&Lr.range(e,r.getTime(),n,i,o)}}r(i)},url:Ir,hex:Ir,email:Ir,required:(e,t,r,n,o)=>{const i=[],s=Array.isArray(t)?"array":typeof t;Lr.required(e,t,n,i,o,s),r(i)},any:(e,t,r,n,o)=>{const i=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(Cr(t)&&!e.required)return r();Lr.required(e,t,n,i,o)}r(i)}};function zr(){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 Mr=zr();class Dr{static register=function(e,t){if("function"!=typeof t)throw new Error("Cannot register a validator by type, validator is not a function");Nr[e]=t};static warning=jr;static messages=Mr;static validators=Nr;rules={};_messages=Mr;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=_r(zr(),e)),this._messages}validate(e,t={},r=(()=>{})){let n=e,o=t,i=r;if("function"==typeof o&&(i=o,o={}),!this.rules||0===Object.keys(this.rules).length)return i&&i(null,n),Promise.resolve(n);if(o.messages){let e=this.messages();e===Mr&&(e=zr()),_r(e,o.messages),o.messages=e}else o.messages=this.messages();const s={};(o.keys||Object.keys(this.rules)).forEach((t=>{const r=this.rules[t];let o=n[t];r.forEach((r=>{let i=r;"function"==typeof i.transform&&(n===e&&(n={...n}),o=n[t]=i.transform(o)),i="function"==typeof i?{validator:i}:{...i},i.validator=this.getValidationMethod(i),i.validator&&(i.field=t,i.fullField=i.fullField||t,i.type=this.getType(i),s[t]=s[t]||[],s[t].push({rule:i,value:o,source:n,field:t}))}))}));const a={};return qr(s,o,((e,t)=>{const r=e.rule;let i,s=!("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 l(i=[]){let l=Array.isArray(i)?i:[i];!0===o.suppressWarning&&l.length&&Dr.warning("async-validator:",l),l.length&&void 0!==r.message&&(l=[].concat(r.message));let c=l.map(Er(r,n));if(o.first&&c.length)return a[r.field]=1,t(c);if(s){if(r.required&&!e.value)return void 0!==r.message?c=[].concat(r.message).map(Er(r,n)):o.error&&(c=[o.error(r,$r(o.messages.required,r.field))]),t(c);let i={};r.defaultField&&Object.keys(e.value).map((e=>{i[e]=r.defaultField})),i={...i,...e.rule.fields};const s={};Object.keys(i).forEach((e=>{const t=i[e],r=Array.isArray(t)?t:[t];s[e]=r.map(u.bind(null,e))}));const a=new Dr(s);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=[];c&&c.length&&r.push(...c),e&&e.length&&r.push(...e),t(r.length?r:null)}))}else t(c)}if(s=s&&(r.required||!r.required&&e.value),r.field=e.field,r.asyncValidator)i=r.asyncValidator(r,e.value,l,e.source,o);else if(r.validator){try{i=r.validator(r,e.value,l,e.source,o)}catch(e){console.error?.(e),o.suppressValidatorError||setTimeout((()=>{throw e}),0),l(e.message)}!0===i?l():!1===i?l("function"==typeof r.message?r.message(r.fullField||r.field):r.message||`${r.fullField||r.field} fails`):i instanceof Array?l(i):i instanceof Error&&l(i.message)}i&&i.then&&i.then((()=>l()),(e=>l(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=Or(t),i(t,r)):i(null,n)}(e)}),n)}getType(e){if(void 0===e.type&&e.pattern instanceof RegExp&&(e.type="pattern"),"function"!=typeof e.validator&&e.type&&!Nr.hasOwnProperty(e.type))throw new Error($r("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]?Nr.required:Nr[this.getType(e)]||void 0}}function Kr(e){return new Dr(e)}var Vr={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:Kr,validate:function(e,t,r={},n=(()=>{})){return xr.run(Kr(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)}};const Hr=e=>{if(!e)return"";if(!lt.isObject(e))return"";let t="";return lt.forof(e,((e,r)=>{r&&(t+=`${Je(e)}:${r};`)})),t},Wr=["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"],Zr=["top","bottom","left","right","padding","margin","marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft","height","width","border","borderLeft","borderRight","borderTop","borderBottom","borderColor","borderRadius"],Qr=(e,t="px")=>e&&t?"0"===e?e:Vr.isFloat(e.toString())?`${e}${t}`:e:e;var Yr={stringify:Hr,parse:(e,{camel:t=!1,pure:r=!0}={})=>{if(!e.trim())return;const n=bt.parse(e,{sep:";",eq:":",uri:!1}),o={};return lt.forof(n,((e,n)=>{if(!n)return;const i=t?r&&e.startsWith("_")?e:Ge(e):e;Vr.isFloat(n)||n.length>=2&&n.startsWith(".")&&Vr.isNumber(n.substr(1))?o[i]=+n:o[i]=n})),o},fixValue:Qr,style:(e,t="px")=>{if(!e)return"";const r=lt.copy(e,{fields:Wr});lt.forof(r,((e,n)=>{(Zr.includes(e)||Zr.includes(Ge(e)))&&(r[e]=Qr(n,t))}));return Hr(r)},commonFields:Wr};var Jr={getDataURL:(e,t)=>{const r={contentType:"",dataUrl:""};return kt.to(fetch(e,{cache:t}).then((e=>(r.contentType=e.headers.get("content-type")||"",e.arrayBuffer()))).then((e=>(r.dataUrl=`data:${r.contentType};base64,`+Zt.ab2str(e,!0),r))))},getArrayBuffer:async(e,t)=>kt.to(fetch(e,{cache:t}).then((e=>e.arrayBuffer()))),getJson:async(e,t)=>kt.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 i=0;const s=[];for(;;){const{done:e,value:r}=await o.read();if(e)break;s.push(r),i+=r.length;const a=St.float(100*i/n,{digits:2});t?.progress&&t?.progress(a,i,n)}const a=new Uint8Array(i);let u=0;for(const e of s)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)=>kt.to(fetch(e,{cache:t}).then((e=>e.text()))),cache:async(e,t="no-cache")=>kt.to(fetch(e,{cache:t}).then((()=>!0)))};const Gr=(e,t="",r=!1)=>{try{if(!e)return;const n=bt.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}?${bt.stringify(t,{uri:!1})}`,i=new XMLHttpRequest;i.open("GET",r,!0),i.responseType="blob",i.onload=function(){Xr(i.response,o)},i.onerror=function(t){console.error(`[ddan] downloadUrl ${e}`,t)},i.send()}}catch(t){console.error(`[ddan] downloadUrl ${e}`,t)}},Xr=(e,t="")=>{try{if(!e)return;const r=URL?.createObjectURL(e);if(!r)return;Gr(r,t),URL?.revokeObjectURL(r)}catch(e){console.error("[ddan] downloadFile",e)}},en=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}},tn=(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)))})),rn=(e,t=!0)=>!(!t||"prompt"!==e)||"granted"===e,nn=(e,t)=>{if(!e||!t)return[];const r=[];let n;for(;null!==(n=t.exec(e));)r.push(n[1]);return r};var on={dataURLtoFile:(e,t)=>{let r=e.split(","),n=r[0].match(/:(.*?);/)[1],o=window.atob(r[1]),i=o.length,s=new Uint8Array(i);for(;i--;)s[i]=o.charCodeAt(i);return new File([s],t,{type:n})},dataURLtoBlob:e=>{let t=e.split(","),r=t[0].match(/:(.*?);/)[1],n=window.atob(t[1]),o=n.length,i=new Uint8Array(o);for(;o--;)i[o]=n.charCodeAt(o);return new Blob([i],{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:Gr,download:(e,t="")=>{e&&("string"!=typeof e?Xr(e,t):Gr(e,t))},downloadFile:Xr,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();Gr(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:i="16px Arial",textAlign:s="left",textBaseline:a="middle"}={})=>{try{if(!e)return"";const u=document.createElement("canvas");u.width=t,u.height=r;const l=u.getContext("2d");return l?(n&&l.rotate(n*Math.PI/180),o&&(l.fillStyle=o),i&&(l.font=i),s&&(l.textAlign=s),a&&(l.textBaseline=a),l.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?tn("clipboard-write").then((t=>{rn(t,!1)?navigator.clipboard.writeText(e).then((()=>r(!0))).catch((()=>r(en(e)))):r(en(e))})).catch((()=>{r(en(e))})):r(en(e))})),queryPermission:tn,isAllowed:rn,legacyCopy:en,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=nn(e,r);t.push(n)})),[].concat(...t)},takeHtml:nn,toBlobUrl:(e,t)=>{const r=new Blob([e],{type:t});return URL.createObjectURL(r)}};class sn{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 an=({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 un(e){const{response:t}=e;return 0===t.code?Promise.resolve(t):Promise.reject(t)}function ln(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(lt.isPlainObject(e)){const r=bt.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 cn{host="";reqConfig={};handleError;interceptors={request:new sn,response:new sn};constructor(e){this.host=e.host||"",this.reqConfig=e.config,this.interceptors.request.use(e.handleRequest||[]),this.interceptors.request.use(ln),this.interceptors.response.use(e.handleResponse||un),this.handleError=e.handleError}static blockId="blockid";static requestLock={};lockR(e,t){cn.requestLock[e]={lock:!0,request:t()}}unlockR(e){delete cn.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=lt.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 i;if(delete o.options.plugins,"block"===r.model)this.lockR(cn.blockId,(()=>an(o))),i=await cn.requestLock[cn.blockId].request;else if(cn.requestLock[cn.blockId]&&cn.requestLock[cn.blockId].lock&&await cn.requestLock[cn.blockId].request,"debounce"===r.model||"debounceUrl"===r.model){let e;e="debounceUrl"===r.model?this.getIdFromReqUrl(o):this.getIdFromReq(o),cn.requestLock[e]||this.lockR(e,(()=>an(o))),i=await cn.requestLock[e].request,this.unlockR(e)}else i=await an(o);return this.interceptors.response.invoke({response:i,config:r,refetch:()=>({sig:"REFETCH",result:this.fetch(e,t)})})}catch(e){return this.handleError&&this.handleError(e),Promise.reject(e)}}}const fn={fetch:Jr,Http:cn,css:Yr,qs:bt,icon:M,html:on};export{fn as dWeb};
|
package/bin/utils.d.ts
CHANGED
package/bin/web.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ddan-js",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.17",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ddan-js",
|
|
@@ -35,17 +35,17 @@
|
|
|
35
35
|
},
|
|
36
36
|
"./hook": {
|
|
37
37
|
"types": "./bin/hook.d.ts",
|
|
38
|
-
"import": "./bin/tiny/hook.
|
|
38
|
+
"import": "./bin/tiny/hook.mjs",
|
|
39
39
|
"require": "./bin/tiny/hook.js"
|
|
40
40
|
},
|
|
41
41
|
"./utils": {
|
|
42
42
|
"types": "./bin/utils.d.ts",
|
|
43
|
-
"import": "./bin/tiny/utils.
|
|
43
|
+
"import": "./bin/tiny/utils.mjs",
|
|
44
44
|
"require": "./bin/tiny/utils.js"
|
|
45
45
|
},
|
|
46
46
|
"./web": {
|
|
47
47
|
"types": "./bin/web.d.ts",
|
|
48
|
-
"import": "./bin/tiny/web.
|
|
48
|
+
"import": "./bin/tiny/web.mjs",
|
|
49
49
|
"require": "./bin/tiny/web.js"
|
|
50
50
|
},
|
|
51
51
|
"./*": "./*"
|