w-serv-orm 1.1.8 → 1.1.9

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/README.md CHANGED
@@ -42,12 +42,7 @@ let url = './db.json'
42
42
  let db = 'worm'
43
43
 
44
44
  //WServOrm
45
- let opt = {
46
- getUserById: null,
47
- useCheckUser: false,
48
- useExcludeWhenNotAdmin: false,
49
- }
50
- let r = WServOrm(ds, WOrm, url, db, opt)
45
+ let r = WServOrm(ds, WOrm, url, db)
51
46
  console.log(r) //回傳server用orm相關函數
52
47
  // => {
53
48
  // backup: [AsyncFunction: backup],
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * w-serv-orm v1.1.8
2
+ * w-serv-orm v1.1.9
3
3
  * (c) 2018-2021 yuda-lyu(semisphere)
4
4
  * Released under the MIT License.
5
5
  */
6
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("fs")):"function"==typeof define&&define.amd?define(["fs"],e):(t="undefined"!=typeof globalThis?globalThis:t||self)["w-serv-orm"]=e(t.fs)}(this,(function(t){"use strict";function e(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(i);++n<i;)o[n]=t[n+e];return o}var r=/\s/;var n=/^\s+/;function i(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&r.test(t.charAt(e)););return e}(t)+1).replace(n,""):t}function o(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var a="object"==typeof global&&global&&global.Object===Object&&global,u="object"==typeof self&&self&&self.Object===Object&&self,s=a||u||Function("return this")(),c=s.Symbol,l=Object.prototype,f=l.hasOwnProperty,d=l.toString,p=c?c.toStringTag:void 0;var h=Object.prototype.toString;var g="[object Null]",v="[object Undefined]",b=c?c.toStringTag:void 0;function m(t){return null==t?void 0===t?v:g:b&&b in Object(t)?function(t){var e=f.call(t,p),r=t[p];try{t[p]=void 0;var n=!0}catch(t){}var i=d.call(t);return n&&(e?t[p]=r:delete t[p]),i}(t):function(t){return h.call(t)}(t)}function y(t){return null!=t&&"object"==typeof t}var w="[object Symbol]";function j(t){return"symbol"==typeof t||y(t)&&m(t)==w}var x=NaN,_=/^[-+]0x[0-9a-f]+$/i,A=/^0b[01]+$/i,O=/^0o[0-7]+$/i,S=parseInt;var $=1/0,k=17976931348623157e292;function I(t){return t?(t=function(t){if("number"==typeof t)return t;if(j(t))return x;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=i(t);var r=A.test(t);return r||O.test(t)?S(t.slice(2),r?2:8):_.test(t)?x:+t}(t))===$||t===-$?(t<0?-1:1)*k:t==t?t:0:0===t?t:0}function T(t){var e=I(t),r=e%1;return e==e?r?e-r:e:0}function P(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););return t}var D,M=function(t,e,r){for(var n=-1,i=Object(t),o=r(t),a=o.length;a--;){var u=o[D?a:++n];if(!1===e(i[u],u,i))break}return t};function C(t){return y(t)&&"[object Arguments]"==m(t)}var E=Object.prototype,U=E.hasOwnProperty,z=E.propertyIsEnumerable,L=C(function(){return arguments}())?C:function(t){return y(t)&&U.call(t,"callee")&&!z.call(t,"callee")},F=L,W=Array.isArray;var B="object"==typeof exports&&exports&&!exports.nodeType&&exports,N=B&&"object"==typeof module&&module&&!module.nodeType&&module,H=N&&N.exports===B?s.Buffer:void 0,V=(H?H.isBuffer:void 0)||function(){return!1},R=9007199254740991,Y=/^(?:0|[1-9]\d*)$/;function q(t,e){var r=typeof t;return!!(e=null==e?R:e)&&("number"==r||"symbol"!=r&&Y.test(t))&&t>-1&&t%1==0&&t<e}var X=9007199254740991;function Z(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=X}var G={};function J(t){return function(e){return t(e)}}G["[object Float32Array]"]=G["[object Float64Array]"]=G["[object Int8Array]"]=G["[object Int16Array]"]=G["[object Int32Array]"]=G["[object Uint8Array]"]=G["[object Uint8ClampedArray]"]=G["[object Uint16Array]"]=G["[object Uint32Array]"]=!0,G["[object Arguments]"]=G["[object Array]"]=G["[object ArrayBuffer]"]=G["[object Boolean]"]=G["[object DataView]"]=G["[object Date]"]=G["[object Error]"]=G["[object Function]"]=G["[object Map]"]=G["[object Number]"]=G["[object Object]"]=G["[object RegExp]"]=G["[object Set]"]=G["[object String]"]=G["[object WeakMap]"]=!1;var Q="object"==typeof exports&&exports&&!exports.nodeType&&exports,K=Q&&"object"==typeof module&&module&&!module.nodeType&&module,tt=K&&K.exports===Q&&a.process,et=function(){try{var t=K&&K.require&&K.require("util").types;return t||tt&&tt.binding&&tt.binding("util")}catch(t){}}(),rt=et&&et.isTypedArray,nt=rt?J(rt):function(t){return y(t)&&Z(t.length)&&!!G[m(t)]},it=Object.prototype.hasOwnProperty;function ot(t,e){var r=W(t),n=!r&&F(t),i=!r&&!n&&V(t),o=!r&&!n&&!i&&nt(t),a=r||n||i||o,u=a?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],s=u.length;for(var c in t)!e&&!it.call(t,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||q(c,s))||u.push(c);return u}var at=Object.prototype;function ut(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||at)}function st(t,e){return function(r){return t(e(r))}}var ct=st(Object.keys,Object),lt=Object.prototype.hasOwnProperty;function ft(t){if(!ut(t))return ct(t);var e=[];for(var r in Object(t))lt.call(t,r)&&"constructor"!=r&&e.push(r);return e}var dt="[object AsyncFunction]",pt="[object Function]",ht="[object GeneratorFunction]",gt="[object Proxy]";function vt(t){if(!o(t))return!1;var e=m(t);return e==pt||e==ht||e==dt||e==gt}function bt(t){return null!=t&&Z(t.length)&&!vt(t)}function mt(t){return bt(t)?ot(t):ft(t)}var yt=function(t,e){return function(r,n){if(null==r)return r;if(!bt(r))return t(r,n);for(var i=r.length,o=e?i:-1,a=Object(r);(e?o--:++o<i)&&!1!==n(a[o],o,a););return r}}((function(t,e){return t&&M(t,e,mt)})),wt=yt;function jt(t){return t}function xt(t,e){var r;return(W(t)?P:wt)(t,"function"==typeof(r=e)?r:jt)}function _t(t){return"[object Array]"===Object.prototype.toString.call(t)}function At(t){return"[object Object]"===Object.prototype.toString.call(t)}function Ot(t){return vt(t)}function St(t,r){let n=function(){let t,e,r=new Promise((function(){t=arguments[0],e=arguments[1]}));return r.resolve=t,r.reject=e,r}();if(!_t(t)&&!At(t))return n.reject("rs is not an array or object"),n;let i=!1;if(At(t)){i=!0;let e=[];xt(t,((t,r)=>{e.push({k:r,v:t})})),t=e}Ot(r)||(r=function(t){return t});let o=-1,a=[];return t.reduce((function(t,e){return t.then((function(t){a.push(t),o+=1;let n=o,u=e;return i&&(n=e.k,u=e.v),Ot(r)?r(u,n):u}))}),Promise.resolve()).then((function(t){var r,i,o,u;a.push(t),u=null==(r=a)?0:r.length,a=u?e(r,(i=o||void 0===i?1:T(i))<0?0:i,u):[],n.resolve(a)})).catch((function(t){n.reject(t)})),n}function $t(t,e){for(var r=-1,n=null==t?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var kt=1/0,It=c?c.prototype:void 0,Tt=It?It.toString:void 0;function Pt(t){if("string"==typeof t)return t;if(W(t))return $t(t,Pt)+"";if(j(t))return Tt?Tt.call(t):"";var e=t+"";return"0"==e&&1/t==-kt?"-0":e}function Dt(t,r,n){var i=t.length;return n=void 0===n?i:n,!r&&n>=i?t:e(t,r,n)}function Mt(t){return t!=t}function Ct(t,e,r){return e==e?function(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}(t,e,r):function(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1}(t,Mt,r)}var Et=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function Ut(t){return Et.test(t)}var zt="\\ud800-\\udfff",Lt="["+zt+"]",Ft="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Wt="\\ud83c[\\udffb-\\udfff]",Bt="[^"+zt+"]",Nt="(?:\\ud83c[\\udde6-\\uddff]){2}",Ht="[\\ud800-\\udbff][\\udc00-\\udfff]",Vt="(?:"+Ft+"|"+Wt+")"+"?",Rt="[\\ufe0e\\ufe0f]?",Yt=Rt+Vt+("(?:\\u200d(?:"+[Bt,Nt,Ht].join("|")+")"+Rt+Vt+")*"),qt="(?:"+[Bt+Ft+"?",Ft,Nt,Ht,Lt].join("|")+")",Xt=RegExp(Wt+"(?="+Wt+")|"+qt+Yt,"g");function Zt(t){return Ut(t)?function(t){return t.match(Xt)||[]}(t):function(t){return t.split("")}(t)}function Gt(t){return null==t?"":Pt(t)}function Jt(t,e,r){if((t=Gt(t))&&(r||void 0===e))return i(t);if(!t||!(e=Pt(e)))return t;var n=Zt(t),o=Zt(e),a=function(t,e){for(var r=-1,n=t.length;++r<n&&Ct(e,t[r],0)>-1;);return r}(n,o),u=function(t,e){for(var r=t.length;r--&&Ct(e,t[r],0)>-1;);return r}(n,o)+1;return Dt(n,a,u).join("")}var Qt,Kt=s["__core-js_shared__"],te=(Qt=/[^.]+$/.exec(Kt&&Kt.keys&&Kt.keys.IE_PROTO||""))?"Symbol(src)_1."+Qt:"";var ee=Function.prototype.toString;function re(t){if(null!=t){try{return ee.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var ne=/^\[object .+?Constructor\]$/,ie=Function.prototype,oe=Object.prototype,ae=ie.toString,ue=oe.hasOwnProperty,se=RegExp("^"+ae.call(ue).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ce(t){return!(!o(t)||(e=t,te&&te in e))&&(vt(t)?se:ne).test(re(t));var e}function le(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return ce(r)?r:void 0}var fe=le(s,"DataView"),de=le(s,"Map"),pe=le(s,"Promise"),he=le(s,"Set"),ge=le(s,"WeakMap"),ve="[object Map]",be="[object Promise]",me="[object Set]",ye="[object WeakMap]",we="[object DataView]",je=re(fe),xe=re(de),_e=re(pe),Ae=re(he),Oe=re(ge),Se=m;(fe&&Se(new fe(new ArrayBuffer(1)))!=we||de&&Se(new de)!=ve||pe&&Se(pe.resolve())!=be||he&&Se(new he)!=me||ge&&Se(new ge)!=ye)&&(Se=function(t){var e=m(t),r="[object Object]"==e?t.constructor:void 0,n=r?re(r):"";if(n)switch(n){case je:return we;case xe:return ve;case _e:return be;case Ae:return me;case Oe:return ye}return e});var $e=Se,ke="[object String]";function Ie(t){return function(e){return null==e?void 0:e[t]}}var Te=Ie("length"),Pe="\\ud800-\\udfff",De="["+Pe+"]",Me="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Ce="\\ud83c[\\udffb-\\udfff]",Ee="[^"+Pe+"]",Ue="(?:\\ud83c[\\udde6-\\uddff]){2}",ze="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="(?:"+Me+"|"+Ce+")"+"?",Fe="[\\ufe0e\\ufe0f]?",We=Fe+Le+("(?:\\u200d(?:"+[Ee,Ue,ze].join("|")+")"+Fe+Le+")*"),Be="(?:"+[Ee+Me+"?",Me,Ue,ze,De].join("|")+")",Ne=RegExp(Ce+"(?="+Ce+")|"+Be+We,"g");function He(t){return Ut(t)?function(t){for(var e=Ne.lastIndex=0;Ne.test(t);)++e;return e}(t):Te(t)}var Ve="[object Map]",Re="[object Set]";function Ye(t){if(null==t)return 0;if(bt(t))return"string"==typeof(e=t)||!W(e)&&y(e)&&m(e)==ke?He(t):t.length;var e,r=$e(t);return r==Ve||r==Re?t.size:ft(t).length}var qe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xe=/^\w*$/;function Ze(t,e){if(W(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!j(t))||(Xe.test(t)||!qe.test(t)||null!=e&&t in Object(e))}var Ge=le(Object,"create");var Je=Object.prototype.hasOwnProperty;var Qe=Object.prototype.hasOwnProperty;function Ke(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function tr(t,e){return t===e||t!=t&&e!=e}function er(t,e){for(var r=t.length;r--;)if(tr(t[r][0],e))return r;return-1}Ke.prototype.clear=function(){this.__data__=Ge?Ge(null):{},this.size=0},Ke.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Ke.prototype.get=function(t){var e=this.__data__;if(Ge){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return Je.call(e,t)?e[t]:void 0},Ke.prototype.has=function(t){var e=this.__data__;return Ge?void 0!==e[t]:Qe.call(e,t)},Ke.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Ge&&void 0===e?"__lodash_hash_undefined__":e,this};var rr=Array.prototype.splice;function nr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function ir(t,e){var r,n,i=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function or(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}nr.prototype.clear=function(){this.__data__=[],this.size=0},nr.prototype.delete=function(t){var e=this.__data__,r=er(e,t);return!(r<0)&&(r==e.length-1?e.pop():rr.call(e,r,1),--this.size,!0)},nr.prototype.get=function(t){var e=this.__data__,r=er(e,t);return r<0?void 0:e[r][1]},nr.prototype.has=function(t){return er(this.__data__,t)>-1},nr.prototype.set=function(t,e){var r=this.__data__,n=er(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},or.prototype.clear=function(){this.size=0,this.__data__={hash:new Ke,map:new(de||nr),string:new Ke}},or.prototype.delete=function(t){var e=ir(this,t).delete(t);return this.size-=e?1:0,e},or.prototype.get=function(t){return ir(this,t).get(t)},or.prototype.has=function(t){return ir(this,t).has(t)},or.prototype.set=function(t,e){var r=ir(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};var ar="Expected a function";function ur(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(ar);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=t.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(ur.Cache||or),r}ur.Cache=or;var sr,cr,lr,fr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,dr=/\\(\\)?/g,pr=(sr=function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(fr,(function(t,r,n,i){e.push(n?i.replace(dr,"$1"):r||t)})),e},cr=ur(sr,(function(t){return 500===lr.size&&lr.clear(),t})),lr=cr.cache,cr),hr=pr;function gr(t,e){return W(t)?t:Ze(t,e)?[t]:hr(Gt(t))}var vr=1/0;function br(t){if("string"==typeof t||j(t))return t;var e=t+"";return"0"==e&&1/t==-vr?"-0":e}function mr(t,e){for(var r=0,n=(e=gr(e,t)).length;null!=t&&r<n;)t=t[br(e[r++])];return r&&r==n?t:void 0}function yr(t,e,r){var n=null==t?void 0:mr(t,e);return void 0===n?r:n}function wr(t){let e=yr(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},"fs");return!!function(t){let e=yr(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},"fs"),r=!1;try{e.statSync(t),r=!0}catch{r=!1}return r}(t,{fs:e})&&(!e.lstatSync(t).isDirectory()&&!e.lstatSync(t).isSymbolicLink())}function jr(t){if(At(t)){for(let e in t)return!0;return!1}return!1}function xr(t){return"[object String]"===Object.prototype.toString.call(t)}function _r(t){return t!=t}function Ar(t){return!!function(t){return"[object Undefined]"===Object.prototype.toString.call(t)}(t)||(!!function(t){return"[object Null]"===Object.prototype.toString.call(t)}(t)||(!!function(t){if(At(t)){for(let e in t)return!1;return!0}return!1}(t)||(!!function(t){return!(!xr(t)||""!==t)}(t)||(!!function(t){return!!_t(t)&&0===t.length}(t)||!!_r(t)))))}function Or(t){return!(!xr(t)||""===t)}function Sr(t){let e=!1;if(Or(t)){if(""===t.trim())return!1;e=!isNaN(Number(t))}else if(function(t){return"[object Number]"===Object.prototype.toString.call(t)}(t)){if(_r(t))return!1;e=!0}return e}function $r(t,e){return!!At(t)&&(!(!Or(e)&&!Sr(e))&&e in t)}var kr="[object Boolean]";function Ir(t){return!0===(e=t)||!1===e||y(e)&&m(e)==kr;var e}let Tr={backup:async function(t){if(!jr(t))throw console.log("woItems",t),new Error("invalid woItems");return await St(t,(async(t,e)=>(console.log("backup...",e),{name:e,data:await t.select()})))},recover:async function(e,r,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!wr(e,{fs:t}))throw console.log("fp",e),new Error("fp is not exist");if(!jr(r))throw console.log("woItems",r),new Error("invalid woItems");Ot(n)||(n=null),Ir(i)||(i=!1);let o=t.readFileSync(e,"utf8");o=Jt(o);let a=function(t){let e=yr(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},"returnWithStateAndMsg",null);Ir(e)||(e=!1);let r=t=>e?{state:"error",msg:t}:{};if(!Or(t))return r("invalid v");let n={};try{n=JSON.parse(t)}catch(t){return r(t.toString())}return e?{state:"success",msg:n}:n}(o);if(!_t(u=a)||0===u.length||1===u.length&&Ar(u[0]))throw new Error("invalid backup data, need a non-empty array");var u;xt(a,((t,e)=>{let n=yr(t,"name");if(!Or(n))throw new Error(`invalid backup data, rs[${e}].name is not a string`);if(!$r(r,n))throw new Error(`invalid backup data, table[${n}] is not in woItems`)})),Ot(n)&&n(),await St(a,(async t=>{console.log("recover...",t.name),i&&(console.log("needCreateStorage"),await r[t.name].createStorage());let e=null;return Ye(t.data)>0&&(e=await r[t.name].insert(t.data)),e}))}};function Pr(t){var e=this.__data__=new nr(t);this.size=e.size}Pr.prototype.clear=function(){this.__data__=new nr,this.size=0},Pr.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Pr.prototype.get=function(t){return this.__data__.get(t)},Pr.prototype.has=function(t){return this.__data__.has(t)},Pr.prototype.set=function(t,e){var r=this.__data__;if(r instanceof nr){var n=r.__data__;if(!de||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new or(n)}return r.set(t,e),this.size=r.size,this};function Dr(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new or;++e<r;)this.add(t[e])}function Mr(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function Cr(t,e){return t.has(e)}Dr.prototype.add=Dr.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Dr.prototype.has=function(t){return this.__data__.has(t)};var Er=1,Ur=2;function zr(t,e,r,n,i,o){var a=r&Er,u=t.length,s=e.length;if(u!=s&&!(a&&s>u))return!1;var c=o.get(t),l=o.get(e);if(c&&l)return c==e&&l==t;var f=-1,d=!0,p=r&Ur?new Dr:void 0;for(o.set(t,e),o.set(e,t);++f<u;){var h=t[f],g=e[f];if(n)var v=a?n(g,h,f,e,t,o):n(h,g,f,t,e,o);if(void 0!==v){if(v)continue;d=!1;break}if(p){if(!Mr(e,(function(t,e){if(!Cr(p,e)&&(h===t||i(h,t,r,n,o)))return p.push(e)}))){d=!1;break}}else if(h!==g&&!i(h,g,r,n,o)){d=!1;break}}return o.delete(t),o.delete(e),d}var Lr=s.Uint8Array;function Fr(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function Wr(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var Br=1,Nr=2,Hr="[object Boolean]",Vr="[object Date]",Rr="[object Error]",Yr="[object Map]",qr="[object Number]",Xr="[object RegExp]",Zr="[object Set]",Gr="[object String]",Jr="[object Symbol]",Qr="[object ArrayBuffer]",Kr="[object DataView]",tn=c?c.prototype:void 0,en=tn?tn.valueOf:void 0;function rn(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}function nn(t,e,r){var n=e(t);return W(t)?n:rn(n,r(t))}function on(t,e){for(var r=-1,n=null==t?0:t.length,i=0,o=[];++r<n;){var a=t[r];e(a,r,t)&&(o[i++]=a)}return o}function an(){return[]}var un=Object.prototype.propertyIsEnumerable,sn=Object.getOwnPropertySymbols,cn=sn?function(t){return null==t?[]:(t=Object(t),on(sn(t),(function(e){return un.call(t,e)})))}:an;function ln(t){return nn(t,mt,cn)}var fn=1,dn=Object.prototype.hasOwnProperty;var pn=1,hn="[object Arguments]",gn="[object Array]",vn="[object Object]",bn=Object.prototype.hasOwnProperty;function mn(t,e,r,n,i,o){var a=W(t),u=W(e),s=a?gn:$e(t),c=u?gn:$e(e),l=(s=s==hn?vn:s)==vn,f=(c=c==hn?vn:c)==vn,d=s==c;if(d&&V(t)){if(!V(e))return!1;a=!0,l=!1}if(d&&!l)return o||(o=new Pr),a||nt(t)?zr(t,e,r,n,i,o):function(t,e,r,n,i,o,a){switch(r){case Kr:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Qr:return!(t.byteLength!=e.byteLength||!o(new Lr(t),new Lr(e)));case Hr:case Vr:case qr:return tr(+t,+e);case Rr:return t.name==e.name&&t.message==e.message;case Xr:case Gr:return t==e+"";case Yr:var u=Fr;case Zr:var s=n&Br;if(u||(u=Wr),t.size!=e.size&&!s)return!1;var c=a.get(t);if(c)return c==e;n|=Nr,a.set(t,e);var l=zr(u(t),u(e),n,i,o,a);return a.delete(t),l;case Jr:if(en)return en.call(t)==en.call(e)}return!1}(t,e,s,r,n,i,o);if(!(r&pn)){var p=l&&bn.call(t,"__wrapped__"),h=f&&bn.call(e,"__wrapped__");if(p||h){var g=p?t.value():t,v=h?e.value():e;return o||(o=new Pr),i(g,v,r,n,o)}}return!!d&&(o||(o=new Pr),function(t,e,r,n,i,o){var a=r&fn,u=ln(t),s=u.length;if(s!=ln(e).length&&!a)return!1;for(var c=s;c--;){var l=u[c];if(!(a?l in e:dn.call(e,l)))return!1}var f=o.get(t),d=o.get(e);if(f&&d)return f==e&&d==t;var p=!0;o.set(t,e),o.set(e,t);for(var h=a;++c<s;){var g=t[l=u[c]],v=e[l];if(n)var b=a?n(v,g,l,e,t,o):n(g,v,l,t,e,o);if(!(void 0===b?g===v||i(g,v,r,n,o):b)){p=!1;break}h||(h="constructor"==l)}if(p&&!h){var m=t.constructor,y=e.constructor;m==y||!("constructor"in t)||!("constructor"in e)||"function"==typeof m&&m instanceof m&&"function"==typeof y&&y instanceof y||(p=!1)}return o.delete(t),o.delete(e),p}(t,e,r,n,i,o))}function yn(t,e,r,n,i){return t===e||(null==t||null==e||!y(t)&&!y(e)?t!=t&&e!=e:mn(t,e,r,n,yn,i))}var wn=1,jn=2;function xn(t){return t==t&&!o(t)}function _n(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}function An(t){var e=function(t){for(var e=mt(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,xn(i)]}return e}(t);return 1==e.length&&e[0][2]?_n(e[0][0],e[0][1]):function(r){return r===t||function(t,e,r,n){var i=r.length,o=i,a=!n;if(null==t)return!o;for(t=Object(t);i--;){var u=r[i];if(a&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++i<o;){var s=(u=r[i])[0],c=t[s],l=u[1];if(a&&u[2]){if(void 0===c&&!(s in t))return!1}else{var f=new Pr;if(n)var d=n(c,l,s,t,e,f);if(!(void 0===d?yn(l,c,wn|jn,n,f):d))return!1}}return!0}(r,t,e)}}function On(t,e){return null!=t&&e in Object(t)}function Sn(t,e){return null!=t&&function(t,e,r){for(var n=-1,i=(e=gr(e,t)).length,o=!1;++n<i;){var a=br(e[n]);if(!(o=null!=t&&r(t,a)))break;t=t[a]}return o||++n!=i?o:!!(i=null==t?0:t.length)&&Z(i)&&q(a,i)&&(W(t)||F(t))}(t,e,On)}var $n=1,kn=2;function In(t){return Ze(t)?Ie(br(t)):function(t){return function(e){return mr(e,t)}}(t)}function Tn(t){return"function"==typeof t?t:null==t?jt:"object"==typeof t?W(t)?(e=t[0],r=t[1],Ze(e)&&xn(r)?_n(br(e),r):function(t){var n=yr(t,e);return void 0===n&&n===r?Sn(t,e):yn(r,n,$n|kn)}):An(t):In(t);var e,r}function Pn(t,e){var r=-1,n=bt(t)?Array(t.length):[];return wt(t,(function(t,i,o){n[++r]=e(t,i,o)})),n}function Dn(t,e){return(W(t)?$t:Pn)(t,Tn(e))}var Mn=Array.prototype.join;function Cn(t,e){return null==t?"":Mn.call(t,e)}var En=et&&et.isRegExp,Un=En?J(En):function(t){return y(t)&&"[object RegExp]"==m(t)},zn=30,Ln="...",Fn=/\w*$/;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var Wn={};!function(t,e){t.exports=function(){var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",o="minute",a="hour",u="day",s="week",c="month",l="quarter",f="year",d="date",p="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],r=t%100;return"["+t+(e[(r-20)%10]||e[r]||e[0])+"]"}},b=function(t,e,r){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(r)+t},m={s:b,z:function(t){var e=-t.utcOffset(),r=Math.abs(e),n=Math.floor(r/60),i=r%60;return(e<=0?"+":"-")+b(n,2,"0")+":"+b(i,2,"0")},m:function t(e,r){if(e.date()<r.date())return-t(r,e);var n=12*(r.year()-e.year())+(r.month()-e.month()),i=e.clone().add(n,c),o=r-i<0,a=e.clone().add(n+(o?-1:1),c);return+(-(n+(r-i)/(o?i-a:a-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:c,y:f,w:s,d:u,D:d,h:a,m:o,s:i,ms:n,Q:l}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},y="en",w={};w[y]=v;var j="$isDayjsObject",x=function(t){return t instanceof S||!(!t||!t[j])},_=function t(e,r,n){var i;if(!e)return y;if("string"==typeof e){var o=e.toLowerCase();w[o]&&(i=o),r&&(w[o]=r,i=o);var a=e.split("-");if(!i&&a.length>1)return t(a[0])}else{var u=e.name;w[u]=e,i=u}return!n&&i&&(y=i),i||!n&&y},A=function(t,e){if(x(t))return t.clone();var r="object"==typeof e?e:{};return r.date=t,r.args=arguments,new S(r)},O=m;O.l=_,O.i=x,O.w=function(t,e){return A(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var S=function(){function v(t){this.$L=_(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[j]=!0}var b=v.prototype;return b.parse=function(t){this.$d=function(t){var e=t.date,r=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var n=e.match(h);if(n){var i=n[2]-1||0,o=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)):new Date(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)}}return new Date(e)}(t),this.init()},b.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},b.$utils=function(){return O},b.isValid=function(){return!(this.$d.toString()===p)},b.isSame=function(t,e){var r=A(t);return this.startOf(e)<=r&&r<=this.endOf(e)},b.isAfter=function(t,e){return A(t)<this.startOf(e)},b.isBefore=function(t,e){return this.endOf(e)<A(t)},b.$g=function(t,e,r){return O.u(t)?this[e]:this.set(r,t)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(t,e){var r=this,n=!!O.u(e)||e,l=O.p(t),p=function(t,e){var i=O.w(r.$u?Date.UTC(r.$y,e,t):new Date(r.$y,e,t),r);return n?i:i.endOf(u)},h=function(t,e){return O.w(r.toDate()[t].apply(r.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(e)),r)},g=this.$W,v=this.$M,b=this.$D,m="set"+(this.$u?"UTC":"");switch(l){case f:return n?p(1,0):p(31,11);case c:return n?p(1,v):p(0,v+1);case s:var y=this.$locale().weekStart||0,w=(g<y?g+7:g)-y;return p(n?b-w:b+(6-w),v);case u:case d:return h(m+"Hours",0);case a:return h(m+"Minutes",1);case o:return h(m+"Seconds",2);case i:return h(m+"Milliseconds",3);default:return this.clone()}},b.endOf=function(t){return this.startOf(t,!1)},b.$set=function(t,e){var r,s=O.p(t),l="set"+(this.$u?"UTC":""),p=(r={},r[u]=l+"Date",r[d]=l+"Date",r[c]=l+"Month",r[f]=l+"FullYear",r[a]=l+"Hours",r[o]=l+"Minutes",r[i]=l+"Seconds",r[n]=l+"Milliseconds",r)[s],h=s===u?this.$D+(e-this.$W):e;if(s===c||s===f){var g=this.clone().set(d,1);g.$d[p](h),g.init(),this.$d=g.set(d,Math.min(this.$D,g.daysInMonth())).$d}else p&&this.$d[p](h);return this.init(),this},b.set=function(t,e){return this.clone().$set(t,e)},b.get=function(t){return this[O.p(t)]()},b.add=function(n,l){var d,p=this;n=Number(n);var h=O.p(l),g=function(t){var e=A(p);return O.w(e.date(e.date()+Math.round(t*n)),p)};if(h===c)return this.set(c,this.$M+n);if(h===f)return this.set(f,this.$y+n);if(h===u)return g(1);if(h===s)return g(7);var v=(d={},d[o]=e,d[a]=r,d[i]=t,d)[h]||1,b=this.$d.getTime()+n*v;return O.w(b,this)},b.subtract=function(t,e){return this.add(-1*t,e)},b.format=function(t){var e=this,r=this.$locale();if(!this.isValid())return r.invalidDate||p;var n=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),o=this.$H,a=this.$m,u=this.$M,s=r.weekdays,c=r.months,l=r.meridiem,f=function(t,r,i,o){return t&&(t[r]||t(e,n))||i[r].slice(0,o)},d=function(t){return O.s(o%12||12,t,"0")},h=l||function(t,e,r){var n=t<12?"AM":"PM";return r?n.toLowerCase():n};return n.replace(g,(function(t,n){return n||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return O.s(e.$y,4,"0");case"M":return u+1;case"MM":return O.s(u+1,2,"0");case"MMM":return f(r.monthsShort,u,c,3);case"MMMM":return f(c,u);case"D":return e.$D;case"DD":return O.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return f(r.weekdaysMin,e.$W,s,2);case"ddd":return f(r.weekdaysShort,e.$W,s,3);case"dddd":return s[e.$W];case"H":return String(o);case"HH":return O.s(o,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return h(o,a,!0);case"A":return h(o,a,!1);case"m":return String(a);case"mm":return O.s(a,2,"0");case"s":return String(e.$s);case"ss":return O.s(e.$s,2,"0");case"SSS":return O.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(n,d,p){var h,g=this,v=O.p(d),b=A(n),m=(b.utcOffset()-this.utcOffset())*e,y=this-b,w=function(){return O.m(g,b)};switch(v){case f:h=w()/12;break;case c:h=w();break;case l:h=w()/3;break;case s:h=(y-m)/6048e5;break;case u:h=(y-m)/864e5;break;case a:h=y/r;break;case o:h=y/e;break;case i:h=y/t;break;default:h=y}return p?h:O.a(h)},b.daysInMonth=function(){return this.endOf(c).$D},b.$locale=function(){return w[this.$L]},b.locale=function(t,e){if(!t)return this.$L;var r=this.clone(),n=_(t,e,!0);return n&&(r.$L=n),r},b.clone=function(){return O.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},v}(),$=S.prototype;return A.prototype=$,[["$ms",n],["$s",i],["$m",o],["$H",a],["$W",u],["$M",c],["$y",f],["$D",d]].forEach((function(t){$[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),A.extend=function(t,e){return t.$i||(t(e,S,A),t.$i=!0),A},A.locale=_,A.isDayjs=x,A.unix=function(t){return A(1e3*t)},A.en=w[y],A.Ls=w,A.p={},A}()}({get exports(){return Wn},set exports(t){Wn=t}});var Bn=Wn;const Nn=[];for(let t=0;t<256;++t)Nn.push((t+256).toString(16).slice(1));const Hn=new Uint8Array(16);function Vn(){return crypto.getRandomValues(Hn)}const Rn={};function Yn(t,e,r){let n;if(t)n=qn(t.random??t.rng?.()??Vn(),t.msecs,t.seq,e,r);else{const t=Date.now(),i=Vn();!function(t,e,r){t.msecs??=-1/0,t.seq??=0,e>t.msecs?(t.seq=Xn(r),t.msecs=e):(t.seq=t.seq+1|0,0===t.seq&&t.msecs++)}(Rn,t,i),n=qn(i,Rn.msecs,Rn.seq,e,r)}return e??function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(Nn[t[e+0]]+Nn[t[e+1]]+Nn[t[e+2]]+Nn[t[e+3]]+"-"+Nn[t[e+4]]+Nn[t[e+5]]+"-"+Nn[t[e+6]]+Nn[t[e+7]]+"-"+Nn[t[e+8]]+Nn[t[e+9]]+"-"+Nn[t[e+10]]+Nn[t[e+11]]+Nn[t[e+12]]+Nn[t[e+13]]+Nn[t[e+14]]+Nn[t[e+15]]).toLowerCase()}(n)}function qn(t,e,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(t.length<16)throw new Error("Random bytes length must be >= 16");if(n){if(i<0||i+16>n.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`)}else n=new Uint8Array(16),i=0;return e??=Date.now(),r??=Xn(t),n[i++]=e/1099511627776&255,n[i++]=e/4294967296&255,n[i++]=e/16777216&255,n[i++]=e/65536&255,n[i++]=e/256&255,n[i++]=255&e,n[i++]=112|r>>>28&15,n[i++]=r>>>20&255,n[i++]=128|r>>>14&63,n[i++]=r>>>6&255,n[i++]=r<<2&255|3&t[10],n[i++]=t[11],n[i++]=t[12],n[i++]=t[13],n[i++]=t[14],n[i++]=t[15],n}function Xn(t){return(127&t[6])<<24|t[7]<<16|t[8]<<8|t[9]}var Zn=function(){try{var t=le(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Gn=Zn;function Jn(t,e,r){"__proto__"==e&&Gn?Gn(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var Qn=Object.prototype.hasOwnProperty;function Kn(t,e,r){var n=t[e];Qn.call(t,e)&&tr(n,r)&&(void 0!==r||e in t)||Jn(t,e,r)}function ti(t,e,r,n){var i=!r;r||(r={});for(var o=-1,a=e.length;++o<a;){var u=e[o],s=n?n(r[u],t[u],u,r,t):void 0;void 0===s&&(s=t[u]),i?Jn(r,u,s):Kn(r,u,s)}return r}var ei=Object.prototype.hasOwnProperty;function ri(t){if(!o(t))return function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}(t);var e=ut(t),r=[];for(var n in t)("constructor"!=n||!e&&ei.call(t,n))&&r.push(n);return r}function ni(t){return bt(t)?ot(t,!0):ri(t)}var ii="object"==typeof exports&&exports&&!exports.nodeType&&exports,oi=ii&&"object"==typeof module&&module&&!module.nodeType&&module,ai=oi&&oi.exports===ii?s.Buffer:void 0,ui=ai?ai.allocUnsafe:void 0;var si=st(Object.getPrototypeOf,Object),ci=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)rn(e,cn(t)),t=si(t);return e}:an,li=ci;function fi(t){return nn(t,ni,li)}var di=Object.prototype.hasOwnProperty;function pi(t){var e=new t.constructor(t.byteLength);return new Lr(e).set(new Lr(t)),e}var hi=/\w*$/;var gi=c?c.prototype:void 0,vi=gi?gi.valueOf:void 0;var bi="[object Boolean]",mi="[object Date]",yi="[object Map]",wi="[object Number]",ji="[object RegExp]",xi="[object Set]",_i="[object String]",Ai="[object Symbol]",Oi="[object ArrayBuffer]",Si="[object DataView]",$i="[object Float32Array]",ki="[object Float64Array]",Ii="[object Int8Array]",Ti="[object Int16Array]",Pi="[object Int32Array]",Di="[object Uint8Array]",Mi="[object Uint8ClampedArray]",Ci="[object Uint16Array]",Ei="[object Uint32Array]";function Ui(t,e,r){var n,i=t.constructor;switch(e){case Oi:return pi(t);case bi:case mi:return new i(+t);case Si:return function(t,e){var r=e?pi(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case $i:case ki:case Ii:case Ti:case Pi:case Di:case Mi:case Ci:case Ei:return function(t,e){var r=e?pi(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}(t,r);case yi:return new i;case wi:case _i:return new i(t);case ji:return function(t){var e=new t.constructor(t.source,hi.exec(t));return e.lastIndex=t.lastIndex,e}(t);case xi:return new i;case Ai:return n=t,vi?Object(vi.call(n)):{}}}var zi=Object.create,Li=function(){function t(){}return function(e){if(!o(e))return{};if(zi)return zi(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}(),Fi=Li;var Wi=et&&et.isMap,Bi=Wi?J(Wi):function(t){return y(t)&&"[object Map]"==$e(t)};var Ni=et&&et.isSet,Hi=Ni?J(Ni):function(t){return y(t)&&"[object Set]"==$e(t)},Vi=1,Ri=2,Yi=4,qi="[object Arguments]",Xi="[object Function]",Zi="[object GeneratorFunction]",Gi="[object Object]",Ji={};function Qi(t,e,r,n,i,a){var u,s=e&Vi,c=e&Ri,l=e&Yi;if(r&&(u=i?r(t,n,i,a):r(t)),void 0!==u)return u;if(!o(t))return t;var f=W(t);if(f){if(u=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&di.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!s)return function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}(t,u)}else{var d=$e(t),p=d==Xi||d==Zi;if(V(t))return function(t,e){if(e)return t.slice();var r=t.length,n=ui?ui(r):new t.constructor(r);return t.copy(n),n}(t,s);if(d==Gi||d==qi||p&&!i){if(u=c||p?{}:function(t){return"function"!=typeof t.constructor||ut(t)?{}:Fi(si(t))}(t),!s)return c?function(t,e){return ti(t,li(t),e)}(t,function(t,e){return t&&ti(e,ni(e),t)}(u,t)):function(t,e){return ti(t,cn(t),e)}(t,function(t,e){return t&&ti(e,mt(e),t)}(u,t))}else{if(!Ji[d])return i?t:{};u=Ui(t,d,s)}}a||(a=new Pr);var h=a.get(t);if(h)return h;a.set(t,u),Hi(t)?t.forEach((function(n){u.add(Qi(n,e,r,n,t,a))})):Bi(t)&&t.forEach((function(n,i){u.set(i,Qi(n,e,r,i,t,a))}));var g=f?void 0:(l?c?fi:ln:c?ni:mt)(t);return P(g||t,(function(n,i){g&&(n=t[i=n]),Kn(u,i,Qi(n,e,r,i,t,a))})),u}Ji[qi]=Ji["[object Array]"]=Ji["[object ArrayBuffer]"]=Ji["[object DataView]"]=Ji["[object Boolean]"]=Ji["[object Date]"]=Ji["[object Float32Array]"]=Ji["[object Float64Array]"]=Ji["[object Int8Array]"]=Ji["[object Int16Array]"]=Ji["[object Int32Array]"]=Ji["[object Map]"]=Ji["[object Number]"]=Ji[Gi]=Ji["[object RegExp]"]=Ji["[object Set]"]=Ji["[object String]"]=Ji["[object Symbol]"]=Ji["[object Uint8Array]"]=Ji["[object Uint8ClampedArray]"]=Ji["[object Uint16Array]"]=Ji["[object Uint32Array]"]=!0,Ji["[object Error]"]=Ji[Xi]=Ji["[object WeakMap]"]=!1;var Ki=1,to=4;var eo={},ro={get exports(){return eo},set exports(t){eo=t}},no={},io={},oo={get exports(){return io},set exports(t){io=t}},ao={};function uo(){var t={"align-content":!1,"align-items":!1,"align-self":!1,"alignment-adjust":!1,"alignment-baseline":!1,all:!1,"anchor-point":!1,animation:!1,"animation-delay":!1,"animation-direction":!1,"animation-duration":!1,"animation-fill-mode":!1,"animation-iteration-count":!1,"animation-name":!1,"animation-play-state":!1,"animation-timing-function":!1,azimuth:!1,"backface-visibility":!1,background:!0,"background-attachment":!0,"background-clip":!0,"background-color":!0,"background-image":!0,"background-origin":!0,"background-position":!0,"background-repeat":!0,"background-size":!0,"baseline-shift":!1,binding:!1,bleed:!1,"bookmark-label":!1,"bookmark-level":!1,"bookmark-state":!1,border:!0,"border-bottom":!0,"border-bottom-color":!0,"border-bottom-left-radius":!0,"border-bottom-right-radius":!0,"border-bottom-style":!0,"border-bottom-width":!0,"border-collapse":!0,"border-color":!0,"border-image":!0,"border-image-outset":!0,"border-image-repeat":!0,"border-image-slice":!0,"border-image-source":!0,"border-image-width":!0,"border-left":!0,"border-left-color":!0,"border-left-style":!0,"border-left-width":!0,"border-radius":!0,"border-right":!0,"border-right-color":!0,"border-right-style":!0,"border-right-width":!0,"border-spacing":!0,"border-style":!0,"border-top":!0,"border-top-color":!0,"border-top-left-radius":!0,"border-top-right-radius":!0,"border-top-style":!0,"border-top-width":!0,"border-width":!0,bottom:!1,"box-decoration-break":!0,"box-shadow":!0,"box-sizing":!0,"box-snap":!0,"box-suppress":!0,"break-after":!0,"break-before":!0,"break-inside":!0,"caption-side":!1,chains:!1,clear:!0,clip:!1,"clip-path":!1,"clip-rule":!1,color:!0,"color-interpolation-filters":!0,"column-count":!1,"column-fill":!1,"column-gap":!1,"column-rule":!1,"column-rule-color":!1,"column-rule-style":!1,"column-rule-width":!1,"column-span":!1,"column-width":!1,columns:!1,contain:!1,content:!1,"counter-increment":!1,"counter-reset":!1,"counter-set":!1,crop:!1,cue:!1,"cue-after":!1,"cue-before":!1,cursor:!1,direction:!1,display:!0,"display-inside":!0,"display-list":!0,"display-outside":!0,"dominant-baseline":!1,elevation:!1,"empty-cells":!1,filter:!1,flex:!1,"flex-basis":!1,"flex-direction":!1,"flex-flow":!1,"flex-grow":!1,"flex-shrink":!1,"flex-wrap":!1,float:!1,"float-offset":!1,"flood-color":!1,"flood-opacity":!1,"flow-from":!1,"flow-into":!1,font:!0,"font-family":!0,"font-feature-settings":!0,"font-kerning":!0,"font-language-override":!0,"font-size":!0,"font-size-adjust":!0,"font-stretch":!0,"font-style":!0,"font-synthesis":!0,"font-variant":!0,"font-variant-alternates":!0,"font-variant-caps":!0,"font-variant-east-asian":!0,"font-variant-ligatures":!0,"font-variant-numeric":!0,"font-variant-position":!0,"font-weight":!0,grid:!1,"grid-area":!1,"grid-auto-columns":!1,"grid-auto-flow":!1,"grid-auto-rows":!1,"grid-column":!1,"grid-column-end":!1,"grid-column-start":!1,"grid-row":!1,"grid-row-end":!1,"grid-row-start":!1,"grid-template":!1,"grid-template-areas":!1,"grid-template-columns":!1,"grid-template-rows":!1,"hanging-punctuation":!1,height:!0,hyphens:!1,icon:!1,"image-orientation":!1,"image-resolution":!1,"ime-mode":!1,"initial-letters":!1,"inline-box-align":!1,"justify-content":!1,"justify-items":!1,"justify-self":!1,left:!1,"letter-spacing":!0,"lighting-color":!0,"line-box-contain":!1,"line-break":!1,"line-grid":!1,"line-height":!1,"line-snap":!1,"line-stacking":!1,"line-stacking-ruby":!1,"line-stacking-shift":!1,"line-stacking-strategy":!1,"list-style":!0,"list-style-image":!0,"list-style-position":!0,"list-style-type":!0,margin:!0,"margin-bottom":!0,"margin-left":!0,"margin-right":!0,"margin-top":!0,"marker-offset":!1,"marker-side":!1,marks:!1,mask:!1,"mask-box":!1,"mask-box-outset":!1,"mask-box-repeat":!1,"mask-box-slice":!1,"mask-box-source":!1,"mask-box-width":!1,"mask-clip":!1,"mask-image":!1,"mask-origin":!1,"mask-position":!1,"mask-repeat":!1,"mask-size":!1,"mask-source-type":!1,"mask-type":!1,"max-height":!0,"max-lines":!1,"max-width":!0,"min-height":!0,"min-width":!0,"move-to":!1,"nav-down":!1,"nav-index":!1,"nav-left":!1,"nav-right":!1,"nav-up":!1,"object-fit":!1,"object-position":!1,opacity:!1,order:!1,orphans:!1,outline:!1,"outline-color":!1,"outline-offset":!1,"outline-style":!1,"outline-width":!1,overflow:!1,"overflow-wrap":!1,"overflow-x":!1,"overflow-y":!1,padding:!0,"padding-bottom":!0,"padding-left":!0,"padding-right":!0,"padding-top":!0,page:!1,"page-break-after":!1,"page-break-before":!1,"page-break-inside":!1,"page-policy":!1,pause:!1,"pause-after":!1,"pause-before":!1,perspective:!1,"perspective-origin":!1,pitch:!1,"pitch-range":!1,"play-during":!1,position:!1,"presentation-level":!1,quotes:!1,"region-fragment":!1,resize:!1,rest:!1,"rest-after":!1,"rest-before":!1,richness:!1,right:!1,rotation:!1,"rotation-point":!1,"ruby-align":!1,"ruby-merge":!1,"ruby-position":!1,"shape-image-threshold":!1,"shape-outside":!1,"shape-margin":!1,size:!1,speak:!1,"speak-as":!1,"speak-header":!1,"speak-numeral":!1,"speak-punctuation":!1,"speech-rate":!1,stress:!1,"string-set":!1,"tab-size":!1,"table-layout":!1,"text-align":!0,"text-align-last":!0,"text-combine-upright":!0,"text-decoration":!0,"text-decoration-color":!0,"text-decoration-line":!0,"text-decoration-skip":!0,"text-decoration-style":!0,"text-emphasis":!0,"text-emphasis-color":!0,"text-emphasis-position":!0,"text-emphasis-style":!0,"text-height":!0,"text-indent":!0,"text-justify":!0,"text-orientation":!0,"text-overflow":!0,"text-shadow":!0,"text-space-collapse":!0,"text-transform":!0,"text-underline-position":!0,"text-wrap":!0,top:!1,transform:!1,"transform-origin":!1,"transform-style":!1,transition:!1,"transition-delay":!1,"transition-duration":!1,"transition-property":!1,"transition-timing-function":!1,"unicode-bidi":!1,"vertical-align":!1,visibility:!1,"voice-balance":!1,"voice-duration":!1,"voice-family":!1,"voice-pitch":!1,"voice-range":!1,"voice-rate":!1,"voice-stress":!1,"voice-volume":!1,volume:!1,"white-space":!1,widows:!1,width:!0,"will-change":!1,"word-break":!0,"word-spacing":!0,"word-wrap":!0,"wrap-flow":!1,"wrap-through":!1,"writing-mode":!1,"z-index":!1};return t}var so=/javascript\s*\:/gim;ao.whiteList=uo(),ao.getDefaultWhiteList=uo,ao.onAttr=function(t,e,r){},ao.onIgnoreAttr=function(t,e,r){},ao.safeAttrValue=function(t,e){return so.test(e)?"":e};var co={indexOf:function(t,e){var r,n;if(Array.prototype.indexOf)return t.indexOf(e);for(r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1},forEach:function(t,e,r){var n,i;if(Array.prototype.forEach)return t.forEach(e,r);for(n=0,i=t.length;n<i;n++)e.call(r,t[n],n,t)},trim:function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(t){return String.prototype.trimRight?t.trimRight():t.replace(/(\s*$)/g,"")}};var lo=function(t,e){";"!==(t=co.trimRight(t))[t.length-1]&&(t+=";");var r=t.length,n=!1,i=0,o=0,a="";function u(){if(!n){var r=co.trim(t.slice(i,o)),u=r.indexOf(":");if(-1!==u){var s=co.trim(r.slice(0,u)),c=co.trim(r.slice(u+1));if(s){var l=e(i,a.length,s,c,r);l&&(a+=l+"; ")}}}i=o+1}for(;o<r;o++){var s=t[o];if("/"===s&&"*"===t[o+1]){var c=t.indexOf("*/",o+2);if(-1===c)break;i=(o=c+1)+1,n=!1}else"("===s?n=!0:")"===s?n=!1:";"===s?n||u():"\n"===s&&u()}return co.trim(a)},fo=ao,po=lo;function ho(t){return null==t}function go(t){(t=function(t){var e={};for(var r in t)e[r]=t[r];return e}(t||{})).whiteList=t.whiteList||fo.whiteList,t.onAttr=t.onAttr||fo.onAttr,t.onIgnoreAttr=t.onIgnoreAttr||fo.onIgnoreAttr,t.safeAttrValue=t.safeAttrValue||fo.safeAttrValue,this.options=t}go.prototype.process=function(t){if(!(t=(t=t||"").toString()))return"";var e=this.options,r=e.whiteList,n=e.onAttr,i=e.onIgnoreAttr,o=e.safeAttrValue;return po(t,(function(t,e,a,u,s){var c=r[a],l=!1;if(!0===c?l=c:"function"==typeof c?l=c(u):c instanceof RegExp&&(l=c.test(u)),!0!==l&&(l=!1),u=o(a,u)){var f,d={position:e,sourcePosition:t,source:s,isWhite:l};return l?ho(f=n(a,u,d))?a+":"+u:f:ho(f=i(a,u,d))?void 0:f}}))};var vo=go;!function(t,e){var r=ao,n=vo;for(var i in(e=t.exports=function(t,e){return new n(e).process(t)}).FilterCSS=n,r)e[i]=r[i];"undefined"!=typeof window&&(window.filterCSS=t.exports)}(oo,io);var bo={indexOf:function(t,e){var r,n;if(Array.prototype.indexOf)return t.indexOf(e);for(r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1},forEach:function(t,e,r){var n,i;if(Array.prototype.forEach)return t.forEach(e,r);for(n=0,i=t.length;n<i;n++)e.call(r,t[n],n,t)},trim:function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(t){var e=/\s|\n|\t/.exec(t);return e?e.index:-1}},mo=io.FilterCSS,yo=io.getDefaultWhiteList,wo=bo;function jo(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var xo=new mo;function _o(t){return t.replace(Ao,"&lt;").replace(Oo,"&gt;")}var Ao=/</g,Oo=/>/g,So=/"/g,$o=/&quot;/g,ko=/&#([a-zA-Z0-9]*);?/gim,Io=/&colon;?/gim,To=/&newline;?/gim,Po=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,Do=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,Mo=/u\s*r\s*l\s*\(.*/gi;function Co(t){return t.replace(So,"&quot;")}function Eo(t){return t.replace($o,'"')}function Uo(t){return t.replace(ko,(function(t,e){return"x"===e[0]||"X"===e[0]?String.fromCharCode(parseInt(e.substr(1),16)):String.fromCharCode(parseInt(e,10))}))}function zo(t){return t.replace(Io,":").replace(To," ")}function Lo(t){for(var e="",r=0,n=t.length;r<n;r++)e+=t.charCodeAt(r)<32?" ":t.charAt(r);return wo.trim(e)}function Fo(t){return t=Lo(t=zo(t=Uo(t=Eo(t))))}function Wo(t){return t=_o(t=Co(t))}no.whiteList={a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]},no.getDefaultWhiteList=jo,no.onTag=function(t,e,r){},no.onIgnoreTag=function(t,e,r){},no.onTagAttr=function(t,e,r){},no.onIgnoreTagAttr=function(t,e,r){},no.safeAttrValue=function(t,e,r,n){if(r=Fo(r),"href"===e||"src"===e){if("#"===(r=wo.trim(r)))return"#";if("http://"!==r.substr(0,7)&&"https://"!==r.substr(0,8)&&"mailto:"!==r.substr(0,7)&&"tel:"!==r.substr(0,4)&&"data:image/"!==r.substr(0,11)&&"ftp://"!==r.substr(0,6)&&"./"!==r.substr(0,2)&&"../"!==r.substr(0,3)&&"#"!==r[0]&&"/"!==r[0])return""}else if("background"===e){if(Po.lastIndex=0,Po.test(r))return""}else if("style"===e){if(Do.lastIndex=0,Do.test(r))return"";if(Mo.lastIndex=0,Mo.test(r)&&(Po.lastIndex=0,Po.test(r)))return"";!1!==n&&(r=(n=n||xo).process(r))}return r=Wo(r)},no.escapeHtml=_o,no.escapeQuote=Co,no.unescapeQuote=Eo,no.escapeHtmlEntities=Uo,no.escapeDangerHtml5Entities=zo,no.clearNonPrintableCharacter=Lo,no.friendlyAttrValue=Fo,no.escapeAttrValue=Wo,no.onIgnoreTagStripAll=function(){return""},no.StripTagBody=function(t,e){"function"!=typeof e&&(e=function(){});var r=!Array.isArray(t),n=[],i=!1;return{onIgnoreTag:function(o,a,u){if(function(e){return!!r||-1!==wo.indexOf(t,e)}(o)){if(u.isClosing){var s="[/removed]",c=u.position+s.length;return n.push([!1!==i?i:u.position,c]),i=!1,s}return i||(i=u.position),"[removed]"}return e(o,a,u)},remove:function(t){var e="",r=0;return wo.forEach(n,(function(n){e+=t.slice(r,n[0]),r=n[1]})),e+=t.slice(r)}}},no.stripCommentTag=function(t){for(var e="",r=0;r<t.length;){var n=t.indexOf("\x3c!--",r);if(-1===n){e+=t.slice(r);break}e+=t.slice(r,n);var i=t.indexOf("--\x3e",n);if(-1===i)break;r=i+3}return e},no.stripBlankChar=function(t){var e=t.split("");return(e=e.filter((function(t){var e=t.charCodeAt(0);return 127!==e&&(!(e<=31)||(10===e||13===e))}))).join("")},no.attributeWrapSign='"',no.cssFilter=xo,no.getDefaultCSSWhiteList=yo;var Bo={},No=bo;function Ho(t){var e,r=No.spaceIndex(t);return e=-1===r?t.slice(1,-1):t.slice(1,r+1),"/"===(e=No.trim(e).toLowerCase()).slice(0,1)&&(e=e.slice(1)),"/"===e.slice(-1)&&(e=e.slice(0,-1)),e}function Vo(t){return"</"===t.slice(0,2)}var Ro=/[^a-zA-Z0-9\\_:.-]/gim;function Yo(t,e){for(;e<t.length;e++){var r=t[e];if(" "!==r)return"="===r?e:-1}}function qo(t,e){for(;e<t.length;e++){var r=t[e];if(" "!==r)return"'"===r||'"'===r?e:-1}}function Xo(t,e){for(;e>0;e--){var r=t[e];if(" "!==r)return"="===r?e:-1}}function Zo(t){return function(t){return'"'===t[0]&&'"'===t[t.length-1]||"'"===t[0]&&"'"===t[t.length-1]}(t)?t.substr(1,t.length-2):t}Bo.parseTag=function(t,e,r){var n="",i=0,o=!1,a=!1,u=0,s=t.length,c="",l="";t:for(u=0;u<s;u++){var f=t.charAt(u);if(!1===o){if("<"===f){o=u;continue}}else if(!1===a){if("<"===f){n+=r(t.slice(i,u)),o=u,i=u;continue}if(">"===f||u===s-1){n+=r(t.slice(i,o)),c=Ho(l=t.slice(o,u+1)),n+=e(o,n.length,c,l,Vo(l)),i=u+1,o=!1;continue}if('"'===f||"'"===f)for(var d=1,p=t.charAt(u-d);""===p.trim()||"="===p;){if("="===p){a=f;continue t}p=t.charAt(u-++d)}}else if(f===a){a=!1;continue}}return i<s&&(n+=r(t.substr(i))),n},Bo.parseAttr=function(t,e){var r=0,n=0,i=[],o=!1,a=t.length;function u(t,r){if(!((t=(t=No.trim(t)).replace(Ro,"").toLowerCase()).length<1)){var n=e(t,r||"");n&&i.push(n)}}for(var s=0;s<a;s++){var c,l=t.charAt(s);if(!1!==o||"="!==l)if(!1===o||s!==n)if(/\s|\n|\t/.test(l)){if(t=t.replace(/\s|\n|\t/g," "),!1===o){if(-1===(c=Yo(t,s))){u(No.trim(t.slice(r,s))),o=!1,r=s+1;continue}s=c-1;continue}if(-1===(c=Xo(t,s-1))){u(o,Zo(No.trim(t.slice(r,s)))),o=!1,r=s+1;continue}}else;else{if(-1===(c=t.indexOf(l,s+1)))break;u(o,No.trim(t.slice(n+1,c))),o=!1,r=(s=c)+1}else o=t.slice(r,s),r=s+1,n='"'===t.charAt(r)||"'"===t.charAt(r)?r:qo(t,s+1)}return r<t.length&&(!1===o?u(t.slice(r)):u(o,Zo(No.trim(t.slice(r))))),No.trim(i.join(" "))};var Go=io.FilterCSS,Jo=no,Qo=Bo,Ko=Qo.parseTag,ta=Qo.parseAttr,ea=bo;function ra(t){return null==t}function na(t){(t=function(t){var e={};for(var r in t)e[r]=t[r];return e}(t||{})).stripIgnoreTag&&(t.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),t.onIgnoreTag=Jo.onIgnoreTagStripAll),t.whiteList||t.allowList?t.whiteList=function(t){var e={};for(var r in t)Array.isArray(t[r])?e[r.toLowerCase()]=t[r].map((function(t){return t.toLowerCase()})):e[r.toLowerCase()]=t[r];return e}(t.whiteList||t.allowList):t.whiteList=Jo.whiteList,this.attributeWrapSign=!0===t.singleQuotedAttributeValue?"'":Jo.attributeWrapSign,t.onTag=t.onTag||Jo.onTag,t.onTagAttr=t.onTagAttr||Jo.onTagAttr,t.onIgnoreTag=t.onIgnoreTag||Jo.onIgnoreTag,t.onIgnoreTagAttr=t.onIgnoreTagAttr||Jo.onIgnoreTagAttr,t.safeAttrValue=t.safeAttrValue||Jo.safeAttrValue,t.escapeHtml=t.escapeHtml||Jo.escapeHtml,this.options=t,!1===t.css?this.cssFilter=!1:(t.css=t.css||{},this.cssFilter=new Go(t.css))}na.prototype.process=function(t){if(!(t=(t=t||"").toString()))return"";var e=this,r=e.options,n=r.whiteList,i=r.onTag,o=r.onIgnoreTag,a=r.onTagAttr,u=r.onIgnoreTagAttr,s=r.safeAttrValue,c=r.escapeHtml,l=e.attributeWrapSign,f=e.cssFilter;r.stripBlankChar&&(t=Jo.stripBlankChar(t)),r.allowCommentTag||(t=Jo.stripCommentTag(t));var d=!1;r.stripIgnoreTagBody&&(d=Jo.StripTagBody(r.stripIgnoreTagBody,o),o=d.onIgnoreTag);var p=Ko(t,(function(t,e,r,d,p){var h={sourcePosition:t,position:e,isClosing:p,isWhite:Object.prototype.hasOwnProperty.call(n,r)},g=i(r,d,h);if(!ra(g))return g;if(h.isWhite){if(h.isClosing)return"</"+r+">";var v=function(t){var e=ea.spaceIndex(t);if(-1===e)return{html:"",closing:"/"===t[t.length-2]};var r="/"===(t=ea.trim(t.slice(e+1,-1)))[t.length-1];return r&&(t=ea.trim(t.slice(0,-1))),{html:t,closing:r}}(d),b=n[r],m=ta(v.html,(function(t,e){var n=-1!==ea.indexOf(b,t),i=a(r,t,e,n);return ra(i)?n?(e=s(r,t,e,f))?t+"="+l+e+l:t:ra(i=u(r,t,e,n))?void 0:i:i}));return d="<"+r,m&&(d+=" "+m),v.closing&&(d+=" /"),d+=">"}return ra(g=o(r,d,h))?c(d):g}),c);return d&&(p=d.remove(p)),p};var ia=na;!function(t,e){var r=no,n=Bo,i=ia;function o(t,e){return new i(e).process(t)}(e=t.exports=o).filterXSS=o,e.FilterXSS=i,function(){for(var t in r)e[t]=r[t];for(var i in n)e[i]=n[i]}(),"undefined"!=typeof window&&(window.filterXSS=t.exports),"undefined"!=typeof self&&"undefined"!=typeof DedicatedWorkerGlobalScope&&self instanceof DedicatedWorkerGlobalScope&&(self.filterXSS=t.exports)}(ro,eo);var oa=eo;function aa(){return"undefined"!=typeof self?self:"undefined"!=typeof window&&void 0!==window.document?window:"undefined"!=typeof global?global:null}let ua=/<(?=[A-Za-z!/?]|$)/g;function sa(t){return t.replace(ua,"&lt;")}let ca={getFilterXSS:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:oa;if(Ot(t))return t;let e=aa(),r=yr(e,"filterXSS",null);if(Ot(r))return r;let n=yr(e,"xss",null);if(Ot(n))return n;throw new Error("invalid filterXSS, g.filterXSS, use script for import")},getOpt:function(t){return{escapeHtml:sa,onIgnoreTagAttr:function(e,r,n,i){if("style"===r)return r+'="'+t.escapeAttrValue(n)+'"'}}}};function la(t){let e=null,r=null;let n=function t(n){return _t(n)||At(n)?(xt(n,(function(e,r){n[r]=t(e)})),n):Or(n)?(i=n,null===e&&(e=ca.getFilterXSS(),r=ca.getOpt(e)),e(i,r)):n;var i}(Qi(t,Ki|to));return n}function fa(t,e){if(!_t(t))return[];_t(e)||(e=[e]);let r=[];return xt(t,((t,n)=>{0===yr(t,"ok")&&r.push({k:n,id:yr(e,[n,"id"]),err:yr(t,"err","")})})),r}function da(t,r){let n=Dn((a=10,(i=r)&&i.length?e(i,0,(a=u||void 0===a?1:T(a))<0?0:a):[]),(t=>Or(t.id)||Sr(t.id)?`id[${function(t,e){var r=zn,n=Ln;if(o(e)){var i="separator"in e?e.separator:i;r="length"in e?T(e.length):r,n="omission"in e?Pt(e.omission):n}var a=(t=Gt(t)).length;if(Ut(t)){var u=Zt(t);a=u.length}if(r>=a)return t;var s=r-He(n);if(s<1)return n;var c=u?Dt(u,0,s).join(""):t.slice(0,s);if(void 0===i)return c+n;if(u&&(s+=c.length-s),Un(i)){if(t.slice(s).search(i)){var l,f=c;for(i.global||(i=RegExp(i.source,Gt(Fn.exec(i))+"g")),i.lastIndex=0;l=i.exec(f);)var d=l.index;c=c.slice(0,void 0===d?s:d)}}else if(t.indexOf(Pt(i),s)!=s){var p=c.lastIndexOf(i);p>-1&&(c=c.slice(0,p))}return c+n}(String(t.id),{length:100,omission:"…"})}]`:`data[${t.k}]`));var i,a,u;let s=`${t}: ${Cn(n,", ")}`;return Ye(r)>10&&(s+=`, ... (${Ye(r)} in total)`),s}function pa(t){let e=[];return xt(_t(t)?t:[t],((t,r)=>{let n=yr(t,"id");Or(n)&&la(n)!==n&&e.push({k:r,id:n})})),e}function ha(t,e){return da(`${t}, id contains HTML markup`,Dn(e,(t=>({k:t.k}))))}function ga(t,e,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"save";if(!jr(t))throw console.log("ds",t),new Error("invalid ds");let o=t[e].keys,a=!1;_t(n)||(a=!0,n=[n]);let u=function(){if(!Ot(Bn))throw new Error("invalid dayjs");return Bn().format("YYYY-MM-DDTHH:mm:ss.SSSZ")}();return i.indexOf("insert")>=0&&(o.indexOf("userId")>=0&&xt(n,((t,e)=>{n[e].userId=r})),o.indexOf("timeCreate")>=0&&xt(n,((t,e)=>{n[e].timeCreate=u})),o.indexOf("userIdUpdate")>=0&&xt(n,((t,e)=>{n[e].userIdUpdate=r})),o.indexOf("timeUpdate")>=0&&xt(n,((t,e)=>{n[e].timeUpdate=u}))),(i.indexOf("insert")>=0||i.indexOf("save")>=0)&&(o.indexOf("userIdUpdate")>=0&&xt(n,((t,e)=>{n[e].userIdUpdate=r})),o.indexOf("timeUpdate")>=0&&xt(n,((t,e)=>{n[e].timeUpdate=u}))),n=Dn(n,((t,e)=>{let r={};return xt(t,((t,e)=>{t=la(t),r[e]=t})),r})),function(t,e){if(e.indexOf("id")<0)return!1;let r=yr(t,"settings",null);if(jr(r)&&!0!==yr(r,"id.pk"))return!1;let n=yr(r,"id.type","")||yr(t,"kpType.id","");return!(Or(n)&&["STRING","TEXT","CHAR","UUID","CITEXT"].indexOf(n.toUpperCase())<0)}(t[e],o)&&xt(n,(t=>{Ye(t)>0&&!Or(t.id)&&!Sr(t.id)&&(t.id=Yn())})),n=a?n[0]:n}function va(t,e){return async(r,n,i,o)=>async function(t,e,r,n,i,o){let a,u=null;if(!jr(e))return Promise.reject("invalid woItems");let s=yr(e,n,null);if(null===s)return Promise.reject(`can not find table[${n}] in ORM`);if("select"===i){if(a=await s.select(o).catch((t=>{console.log(`${n}.select catch`,t),u="failed to select data"})),Or(u))return Promise.reject(u)}else if("insert"===i||"save"===i){let e=o,c=pa(o);if(Ye(c)>0)return console.log(`${n}.${i} id changed by clearXSS`,c),Promise.reject(ha("insert"===i?"failed to insert data":"failed to save data",c));try{o=ga(t,n,r,o,i)}catch(t){return console.log(`${n}.adjustData catch`,t.toString()),u="failed to adjust data",Promise.reject(u)}if("insert"===i?a=await s.insert(o).catch((t=>{console.log(`${n}.insert catch`,t),u="failed to insert data"})):"save"===i&&(a=await s.save(o).catch((t=>{console.log(`${n}.save catch`,t),u="failed to save data"}))),Or(u))return Promise.reject(u);if("save"===i){let t=fa(a,o);if(Ye(t)>0)return console.log(`${n}.save fail`,t),Promise.reject(da("failed to save data",fa(a,e)))}a=_t(o)?Dn(o,(t=>({id:t.id}))):{id:o.id}}else if("del"===i){if(a=await s.del(o).catch((t=>{console.log(`${n}.del catch`,t),u="failed to delete data"})),!Or(u)){let t=fa(a,o);Ye(t)>0&&(console.log(`${n}.del fail`,t),u=da("failed to delete data",t))}}else if("delAll"===i)a=await s.delAll(o).catch((t=>{console.log(`${n}.delAll catch`,t),u="failed to delete data"}));else if("mix"===i){if(!jr(o))return Promise.reject("invalid input of mix, need the result object of ltdtDiffByKey");let e,i=[];for(let[t,e]of[["add","failed to insert data"],["diff","failed to update data"]]){let r=pa(yr(o,t,[]));Ye(r)>0&&(console.log(`${n}.mix ${t} id changed by clearXSS`,r),i.push(ha(e,r)))}if(Ye(i)>0)return Promise.reject(Cn(i,"; "));a=[];let c=[],l=yr(o,"add",[]);if(Ye(l)>0){try{l=ga(t,n,r,l,"insert+save")}catch(t){return console.log(`${n}.adjustData catch`,t.toString()),u="failed to adjust data",Promise.reject(u)}if(await s.insert(l).catch((t=>{console.log(`${n}.insert catch`,t),u="failed to insert data"})),Or(u))return Promise.reject(u);e=Dn(l,(t=>({id:t.id}))),a=[...a,...e]}let f=yr(o,"del",[]);if(Ye(f)>0){let t=await s.del(f).catch((t=>{console.log(`${n}.del catch`,t),u="failed to delete data"}));if(Or(u))return Promise.reject(u);let r=fa(t,f);Ye(r)>0&&(console.log(`${n}.del fail`,r),c.push(da("failed to delete data",r))),e=Dn(f,(t=>({id:t.id}))),a=[...a,...e]}let d=yr(o,"diff",[]);if(Ye(d)>0){let i=d;try{d=ga(t,n,r,d)}catch(t){return console.log(`${n}.adjustData catch`,t.toString()),u="failed to adjust data",Promise.reject(u)}let o=await s.save(d).catch((t=>{console.log(`${n}.save catch`,t),u="failed to update data"}));if(Or(u))return Promise.reject(u);let l=fa(o,d);Ye(l)>0&&(console.log(`${n}.save fail`,l),c.push(da("failed to update data",fa(o,i)))),e=Dn(d,(t=>({id:t.id}))),a=[...a,...e]}if(Ye(c)>0)return Promise.reject(Cn(c,"; "))}else u=`invalid mode: ${i}`;return Or(u)?Promise.reject(u):a}(t,e,r,n,i,o)}function ba(t,e){var r=[];return wt(t,(function(t,n,i){e(t,n,i)&&r.push(t)})),r}function ma(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!Ot(e)){let i=`${r} needs a function, but got ${typeof e}`;throw n&&t.push((()=>Promise.reject(i))),new Error(i)}setTimeout((()=>{t.push(e)}),1)}async function ya(t,e,r,n,i){if(!Ot(t.mapOrm))return Promise.reject("invalid mapOrm");if(t.useCheckUser&&!Or(e))return console.log("userId",e),console.log("invalid userId"),Promise.reject("invalid userId");let o="n";if(t.useCheckUser){if(!Ot(t.getUserById))return Promise.reject("invalid getUserById");let r=await t.getUserById(e);if(!r)return console.log("userId",e),console.log("can not find user"),Promise.reject("can not find user");o=yr(r,"isAdmin"),"y"!==o&&"n"!==o&&(o="n");let n=yr(r,"isActive");if("y"!==n&&"n"!==n&&(n="n"),"y"!==n)return console.log("userId",e),console.log("oSelf",r),console.log("user is inactive or invalid"),Promise.reject("user is inactive or invalid")}await St(t.funChecks,(t=>t({woName:r,userId:e,isAdmin:o,mode:n,input:i})));for(let a of[...t.funPreProcessing]){let t=await a({woName:r,userId:e,isAdmin:o,mode:n,input:i});if(!jr(t)||void 0===t.input)return Promise.reject("invalid return of pre-processing, need an object with input");i=t.input}let a=await t.mapOrm(e,r,n,i);var u,s;t.useExcludeWhenNotAdmin&&"n"===o&&"select"===n&&_t(a)&&(s=t=>!($r(t,"isActive")&&"n"===t.isActive),a=(W(u=a)?on:ba)(u,Tn(s)));for(let u of[...t.funPostProcessing])a=await u({woName:r,userId:e,isAdmin:o,mode:n,input:i,output:a});return a}return function(t,e,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=function(t,e,r,n){if(!jr(t))throw console.log("ds",t),new Error("invalid ds");if(!Ot(e))throw console.log("WOrm",e),new Error("invalid WOrm");if(!Or(r))throw console.log("url",r),new Error("invalid url");if(!Or(n))throw console.log("db",n),new Error("invalid db");let i={};return xt(mt(t),(t=>{let o=new e({url:r,db:n,cl:t});i[t]=o})),i}(t,e,r,n),a=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Ot(t))return Promise.reject("invalid mapOrm");let r=yr(e,"useCheckUser");Ir(r)||(r=!0);let n=yr(e,"getUserById"),i=yr(e,"useExcludeWhenNotAdmin");Ir(i)||(i=!0);let o={funChecks:[],funPreProcessing:[],funPostProcessing:[],mapOrm:t,getUserById:n,useCheckUser:r,useExcludeWhenNotAdmin:i};return{addFunCheck:t=>{ma(o.funChecks,t,"addFunCheck",!0)},addFunPreProcessing:t=>{ma(o.funPreProcessing,t,"addFunPreProcessing")},addFunPostProcessing:t=>{ma(o.funPostProcessing,t,"addFunPostProcessing")},procOrm:async(t,e,r,n)=>ya(o,t,e,r,n)}}(va(t,o),i);return{...Tr,woItems:o,closeAll:async()=>{await St(o,(async t=>{t&&Ot(t.close)&&await t.close()}))},...a}}}));
6
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("fs")):"function"==typeof define&&define.amd?define(["fs"],e):(t="undefined"!=typeof globalThis?globalThis:t||self)["w-serv-orm"]=e(t.fs)}(this,(function(t){"use strict";var e=Array.isArray,r="object"==typeof global&&global&&global.Object===Object&&global,n="object"==typeof self&&self&&self.Object===Object&&self,o=r||n||Function("return this")(),i=o.Symbol,a=Object.prototype,u=a.hasOwnProperty,s=a.toString,c=i?i.toStringTag:void 0;var l=Object.prototype.toString;var f="[object Null]",d="[object Undefined]",p=i?i.toStringTag:void 0;function h(t){return null==t?void 0===t?d:f:p&&p in Object(t)?function(t){var e=u.call(t,c),r=t[c];try{t[c]=void 0;var n=!0}catch(t){}var o=s.call(t);return n&&(e?t[c]=r:delete t[c]),o}(t):function(t){return l.call(t)}(t)}function g(t){return null!=t&&"object"==typeof t}var v="[object Symbol]";function b(t){return"symbol"==typeof t||g(t)&&h(t)==v}var m=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,y=/^\w*$/;function w(t,r){if(e(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!b(t))||(y.test(t)||!m.test(t)||null!=r&&t in Object(r))}function j(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var x="[object AsyncFunction]",_="[object Function]",O="[object GeneratorFunction]",S="[object Proxy]";function $(t){if(!j(t))return!1;var e=h(t);return e==_||e==O||e==x||e==S}var A,k=o["__core-js_shared__"],I=(A=/[^.]+$/.exec(k&&k.keys&&k.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"";var T=Function.prototype.toString;function P(t){if(null!=t){try{return T.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var D=/^\[object .+?Constructor\]$/,M=Function.prototype,C=Object.prototype,E=M.toString,z=C.hasOwnProperty,L=RegExp("^"+E.call(z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function U(t){return!(!j(t)||(e=t,I&&I in e))&&($(t)?L:D).test(P(t));var e}function F(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return U(r)?r:void 0}var W=F(Object,"create");var N=Object.prototype.hasOwnProperty;var H=Object.prototype.hasOwnProperty;function V(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function B(t,e){return t===e||t!=t&&e!=e}function R(t,e){for(var r=t.length;r--;)if(B(t[r][0],e))return r;return-1}V.prototype.clear=function(){this.__data__=W?W(null):{},this.size=0},V.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},V.prototype.get=function(t){var e=this.__data__;if(W){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return N.call(e,t)?e[t]:void 0},V.prototype.has=function(t){var e=this.__data__;return W?void 0!==e[t]:H.call(e,t)},V.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=W&&void 0===e?"__lodash_hash_undefined__":e,this};var Y=Array.prototype.splice;function q(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}q.prototype.clear=function(){this.__data__=[],this.size=0},q.prototype.delete=function(t){var e=this.__data__,r=R(e,t);return!(r<0)&&(r==e.length-1?e.pop():Y.call(e,r,1),--this.size,!0)},q.prototype.get=function(t){var e=this.__data__,r=R(e,t);return r<0?void 0:e[r][1]},q.prototype.has=function(t){return R(this.__data__,t)>-1},q.prototype.set=function(t,e){var r=this.__data__,n=R(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};var X=F(o,"Map");function Z(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function G(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}G.prototype.clear=function(){this.size=0,this.__data__={hash:new V,map:new(X||q),string:new V}},G.prototype.delete=function(t){var e=Z(this,t).delete(t);return this.size-=e?1:0,e},G.prototype.get=function(t){return Z(this,t).get(t)},G.prototype.has=function(t){return Z(this,t).has(t)},G.prototype.set=function(t,e){var r=Z(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};var J="Expected a function";function Q(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(J);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=t.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(Q.Cache||G),r}Q.Cache=G;var K,tt,et,rt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nt=/\\(\\)?/g,ot=(K=function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(rt,(function(t,r,n,o){e.push(n?o.replace(nt,"$1"):r||t)})),e},tt=Q(K,(function(t){return 500===et.size&&et.clear(),t})),et=tt.cache,tt),it=ot;function at(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}var ut=1/0,st=i?i.prototype:void 0,ct=st?st.toString:void 0;function lt(t){if("string"==typeof t)return t;if(e(t))return at(t,lt)+"";if(b(t))return ct?ct.call(t):"";var r=t+"";return"0"==r&&1/t==-ut?"-0":r}function ft(t){return null==t?"":lt(t)}function dt(t,r){return e(t)?t:w(t,r)?[t]:it(ft(t))}var pt=1/0;function ht(t){if("string"==typeof t||b(t))return t;var e=t+"";return"0"==e&&1/t==-pt?"-0":e}function gt(t,e){for(var r=0,n=(e=dt(e,t)).length;null!=t&&r<n;)t=t[ht(e[r++])];return r&&r==n?t:void 0}function vt(t,e,r){var n=null==t?void 0:gt(t,e);return void 0===n?r:n}function bt(t,e,r){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(r=r>o?o:r)<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var i=Array(o);++n<o;)i[n]=t[n+e];return i}var mt=/\s/;var yt=/^\s+/;function wt(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&mt.test(t.charAt(e)););return e}(t)+1).replace(yt,""):t}var jt=NaN,xt=/^[-+]0x[0-9a-f]+$/i,_t=/^0b[01]+$/i,Ot=/^0o[0-7]+$/i,St=parseInt;var $t=1/0,At=17976931348623157e292;function kt(t){return t?(t=function(t){if("number"==typeof t)return t;if(b(t))return jt;if(j(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=j(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=wt(t);var r=_t.test(t);return r||Ot.test(t)?St(t.slice(2),r?2:8):xt.test(t)?jt:+t}(t))===$t||t===-$t?(t<0?-1:1)*At:t==t?t:0:0===t?t:0}function It(t){var e=kt(t),r=e%1;return e==e?r?e-r:e:0}function Tt(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););return t}var Pt,Dt=function(t,e,r){for(var n=-1,o=Object(t),i=r(t),a=i.length;a--;){var u=i[Pt?a:++n];if(!1===e(o[u],u,o))break}return t};function Mt(t){return g(t)&&"[object Arguments]"==h(t)}var Ct=Object.prototype,Et=Ct.hasOwnProperty,zt=Ct.propertyIsEnumerable,Lt=Mt(function(){return arguments}())?Mt:function(t){return g(t)&&Et.call(t,"callee")&&!zt.call(t,"callee")},Ut=Lt;var Ft="object"==typeof exports&&exports&&!exports.nodeType&&exports,Wt=Ft&&"object"==typeof module&&module&&!module.nodeType&&module,Nt=Wt&&Wt.exports===Ft?o.Buffer:void 0,Ht=(Nt?Nt.isBuffer:void 0)||function(){return!1},Vt=9007199254740991,Bt=/^(?:0|[1-9]\d*)$/;function Rt(t,e){var r=typeof t;return!!(e=null==e?Vt:e)&&("number"==r||"symbol"!=r&&Bt.test(t))&&t>-1&&t%1==0&&t<e}var Yt=9007199254740991;function qt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Yt}var Xt={};function Zt(t){return function(e){return t(e)}}Xt["[object Float32Array]"]=Xt["[object Float64Array]"]=Xt["[object Int8Array]"]=Xt["[object Int16Array]"]=Xt["[object Int32Array]"]=Xt["[object Uint8Array]"]=Xt["[object Uint8ClampedArray]"]=Xt["[object Uint16Array]"]=Xt["[object Uint32Array]"]=!0,Xt["[object Arguments]"]=Xt["[object Array]"]=Xt["[object ArrayBuffer]"]=Xt["[object Boolean]"]=Xt["[object DataView]"]=Xt["[object Date]"]=Xt["[object Error]"]=Xt["[object Function]"]=Xt["[object Map]"]=Xt["[object Number]"]=Xt["[object Object]"]=Xt["[object RegExp]"]=Xt["[object Set]"]=Xt["[object String]"]=Xt["[object WeakMap]"]=!1;var Gt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Jt=Gt&&"object"==typeof module&&module&&!module.nodeType&&module,Qt=Jt&&Jt.exports===Gt&&r.process,Kt=function(){try{var t=Jt&&Jt.require&&Jt.require("util").types;return t||Qt&&Qt.binding&&Qt.binding("util")}catch(t){}}(),te=Kt&&Kt.isTypedArray,ee=te?Zt(te):function(t){return g(t)&&qt(t.length)&&!!Xt[h(t)]},re=Object.prototype.hasOwnProperty;function ne(t,r){var n=e(t),o=!n&&Ut(t),i=!n&&!o&&Ht(t),a=!n&&!o&&!i&&ee(t),u=n||o||i||a,s=u?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],c=s.length;for(var l in t)!r&&!re.call(t,l)||u&&("length"==l||i&&("offset"==l||"parent"==l)||a&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Rt(l,c))||s.push(l);return s}var oe=Object.prototype;function ie(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||oe)}function ae(t,e){return function(r){return t(e(r))}}var ue=ae(Object.keys,Object),se=Object.prototype.hasOwnProperty;function ce(t){if(!ie(t))return ue(t);var e=[];for(var r in Object(t))se.call(t,r)&&"constructor"!=r&&e.push(r);return e}function le(t){return null!=t&&qt(t.length)&&!$(t)}function fe(t){return le(t)?ne(t):ce(t)}var de=function(t,e){return function(r,n){if(null==r)return r;if(!le(r))return t(r,n);for(var o=r.length,i=e?o:-1,a=Object(r);(e?i--:++i<o)&&!1!==n(a[i],i,a););return r}}((function(t,e){return t&&Dt(t,e,fe)})),pe=de;function he(t){return t}function ge(t,r){var n;return(e(t)?Tt:pe)(t,"function"==typeof(n=r)?n:he)}function ve(t){return"[object Array]"===Object.prototype.toString.call(t)}function be(t){return"[object Object]"===Object.prototype.toString.call(t)}function me(t){return $(t)}function ye(t,e){let r=function(){let t,e,r=new Promise((function(){t=arguments[0],e=arguments[1]}));return r.resolve=t,r.reject=e,r}();if(!ve(t)&&!be(t))return r.reject("rs is not an array or object"),r;let n=!1;if(be(t)){n=!0;let e=[];ge(t,((t,r)=>{e.push({k:r,v:t})})),t=e}me(e)||(e=function(t){return t});let o=-1,i=[];return t.reduce((function(t,r){return t.then((function(t){i.push(t),o+=1;let a=o,u=r;return n&&(a=r.k,u=r.v),me(e)?e(u,a):u}))}),Promise.resolve()).then((function(t){var e,n,o,a;i.push(t),a=null==(e=i)?0:e.length,i=a?bt(e,(n=o||void 0===n?1:It(n))<0?0:n,a):[],r.resolve(i)})).catch((function(t){r.reject(t)})),r}function we(t,e,r){var n=t.length;return r=void 0===r?n:r,!e&&r>=n?t:bt(t,e,r)}function je(t){return t!=t}function xe(t,e,r){return e==e?function(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}(t,e,r):function(t,e,r,n){for(var o=t.length,i=r+(n?1:-1);n?i--:++i<o;)if(e(t[i],i,t))return i;return-1}(t,je,r)}var _e=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function Oe(t){return _e.test(t)}var Se="\\ud800-\\udfff",$e="["+Se+"]",Ae="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",ke="\\ud83c[\\udffb-\\udfff]",Ie="[^"+Se+"]",Te="(?:\\ud83c[\\udde6-\\uddff]){2}",Pe="[\\ud800-\\udbff][\\udc00-\\udfff]",De="(?:"+Ae+"|"+ke+")"+"?",Me="[\\ufe0e\\ufe0f]?",Ce=Me+De+("(?:\\u200d(?:"+[Ie,Te,Pe].join("|")+")"+Me+De+")*"),Ee="(?:"+[Ie+Ae+"?",Ae,Te,Pe,$e].join("|")+")",ze=RegExp(ke+"(?="+ke+")|"+Ee+Ce,"g");function Le(t){return Oe(t)?function(t){return t.match(ze)||[]}(t):function(t){return t.split("")}(t)}function Ue(t,e,r){if((t=ft(t))&&(r||void 0===e))return wt(t);if(!t||!(e=lt(e)))return t;var n=Le(t),o=Le(e),i=function(t,e){for(var r=-1,n=t.length;++r<n&&xe(e,t[r],0)>-1;);return r}(n,o),a=function(t,e){for(var r=t.length;r--&&xe(e,t[r],0)>-1;);return r}(n,o)+1;return we(n,i,a).join("")}var Fe=F(o,"DataView"),We=F(o,"Promise"),Ne=F(o,"Set"),He=F(o,"WeakMap"),Ve="[object Map]",Be="[object Promise]",Re="[object Set]",Ye="[object WeakMap]",qe="[object DataView]",Xe=P(Fe),Ze=P(X),Ge=P(We),Je=P(Ne),Qe=P(He),Ke=h;(Fe&&Ke(new Fe(new ArrayBuffer(1)))!=qe||X&&Ke(new X)!=Ve||We&&Ke(We.resolve())!=Be||Ne&&Ke(new Ne)!=Re||He&&Ke(new He)!=Ye)&&(Ke=function(t){var e=h(t),r="[object Object]"==e?t.constructor:void 0,n=r?P(r):"";if(n)switch(n){case Xe:return qe;case Ze:return Ve;case Ge:return Be;case Je:return Re;case Qe:return Ye}return e});var tr=Ke,er="[object String]";function rr(t){return function(e){return null==e?void 0:e[t]}}var nr=rr("length"),or="\\ud800-\\udfff",ir="["+or+"]",ar="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",ur="\\ud83c[\\udffb-\\udfff]",sr="[^"+or+"]",cr="(?:\\ud83c[\\udde6-\\uddff]){2}",lr="[\\ud800-\\udbff][\\udc00-\\udfff]",fr="(?:"+ar+"|"+ur+")"+"?",dr="[\\ufe0e\\ufe0f]?",pr=dr+fr+("(?:\\u200d(?:"+[sr,cr,lr].join("|")+")"+dr+fr+")*"),hr="(?:"+[sr+ar+"?",ar,cr,lr,ir].join("|")+")",gr=RegExp(ur+"(?="+ur+")|"+hr+pr,"g");function vr(t){return Oe(t)?function(t){for(var e=gr.lastIndex=0;gr.test(t);)++e;return e}(t):nr(t)}var br="[object Map]",mr="[object Set]";function yr(t){if(null==t)return 0;if(le(t))return"string"==typeof(r=t)||!e(r)&&g(r)&&h(r)==er?vr(t):t.length;var r,n=tr(t);return n==br||n==mr?t.size:ce(t).length}function wr(t){let e=vt(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},"fs");return!!function(t){let e=vt(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},"fs"),r=!1;try{e.statSync(t),r=!0}catch{r=!1}return r}(t,{fs:e})&&(!e.lstatSync(t).isDirectory()&&!e.lstatSync(t).isSymbolicLink())}function jr(t){if(be(t)){for(let e in t)return!0;return!1}return!1}function xr(t){return"[object String]"===Object.prototype.toString.call(t)}function _r(t){return t!=t}function Or(t){return!!function(t){return"[object Undefined]"===Object.prototype.toString.call(t)}(t)||(!!function(t){return"[object Null]"===Object.prototype.toString.call(t)}(t)||(!!function(t){if(be(t)){for(let e in t)return!1;return!0}return!1}(t)||(!!function(t){return!(!xr(t)||""!==t)}(t)||(!!function(t){return!!ve(t)&&0===t.length}(t)||!!_r(t)))))}function Sr(t){return!(!xr(t)||""===t)}function $r(t){let e=!1;if(Sr(t)){if(""===t.trim())return!1;e=!isNaN(Number(t))}else if(function(t){return"[object Number]"===Object.prototype.toString.call(t)}(t)){if(_r(t))return!1;e=!0}return e}var Ar="[object Boolean]";function kr(t){return!0===(e=t)||!1===e||g(e)&&h(e)==Ar;var e}let Ir={backup:async function(t){if(!jr(t))throw console.log("woItems",t),new Error("invalid woItems");return await ye(t,(async(t,e)=>(console.log("backup...",e),{name:e,data:await t.select()})))},recover:async function(e,r,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!wr(e,{fs:t}))throw console.log("fp",e),new Error("fp is not exist");if(!jr(r))throw console.log("woItems",r),new Error("invalid woItems");me(n)||(n=null),kr(o)||(o=!1);let i=t.readFileSync(e,"utf8");i=Ue(i);let a=function(t){let e=vt(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},"returnWithStateAndMsg",null);kr(e)||(e=!1);let r=t=>e?{state:"error",msg:t}:{};if(!Sr(t))return r("invalid v");let n={};try{n=JSON.parse(t)}catch(t){return r(t.toString())}return e?{state:"success",msg:n}:n}(i);if(!ve(u=a)||0===u.length||1===u.length&&Or(u[0]))throw new Error("invalid backup data, need a non-empty array");var u;ge(a,((t,e)=>{let n=vt(t,"name");if(!Sr(n))throw new Error(`invalid backup data, rs[${e}].name is not a string`);if(i=n,!be(o=r)||!Sr(i)&&!$r(i)||!(i in o))throw new Error(`invalid backup data, table[${n}] is not in woItems`);var o,i})),me(n)&&n(),await ye(a,(async t=>{console.log("recover...",t.name),o&&(console.log("needCreateStorage"),await r[t.name].createStorage());let e=null;return yr(t.data)>0&&(e=await r[t.name].insert(t.data)),e}))}};function Tr(t){var e=this.__data__=new q(t);this.size=e.size}Tr.prototype.clear=function(){this.__data__=new q,this.size=0},Tr.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Tr.prototype.get=function(t){return this.__data__.get(t)},Tr.prototype.has=function(t){return this.__data__.has(t)},Tr.prototype.set=function(t,e){var r=this.__data__;if(r instanceof q){var n=r.__data__;if(!X||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new G(n)}return r.set(t,e),this.size=r.size,this};function Pr(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new G;++e<r;)this.add(t[e])}function Dr(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function Mr(t,e){return t.has(e)}Pr.prototype.add=Pr.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Pr.prototype.has=function(t){return this.__data__.has(t)};var Cr=1,Er=2;function zr(t,e,r,n,o,i){var a=r&Cr,u=t.length,s=e.length;if(u!=s&&!(a&&s>u))return!1;var c=i.get(t),l=i.get(e);if(c&&l)return c==e&&l==t;var f=-1,d=!0,p=r&Er?new Pr:void 0;for(i.set(t,e),i.set(e,t);++f<u;){var h=t[f],g=e[f];if(n)var v=a?n(g,h,f,e,t,i):n(h,g,f,t,e,i);if(void 0!==v){if(v)continue;d=!1;break}if(p){if(!Dr(e,(function(t,e){if(!Mr(p,e)&&(h===t||o(h,t,r,n,i)))return p.push(e)}))){d=!1;break}}else if(h!==g&&!o(h,g,r,n,i)){d=!1;break}}return i.delete(t),i.delete(e),d}var Lr=o.Uint8Array;function Ur(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function Fr(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var Wr=1,Nr=2,Hr="[object Boolean]",Vr="[object Date]",Br="[object Error]",Rr="[object Map]",Yr="[object Number]",qr="[object RegExp]",Xr="[object Set]",Zr="[object String]",Gr="[object Symbol]",Jr="[object ArrayBuffer]",Qr="[object DataView]",Kr=i?i.prototype:void 0,tn=Kr?Kr.valueOf:void 0;function en(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}function rn(t,r,n){var o=r(t);return e(t)?o:en(o,n(t))}function nn(){return[]}var on=Object.prototype.propertyIsEnumerable,an=Object.getOwnPropertySymbols,un=an?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var a=t[r];e(a,r,t)&&(i[o++]=a)}return i}(an(t),(function(e){return on.call(t,e)})))}:nn,sn=un;function cn(t){return rn(t,fe,sn)}var ln=1,fn=Object.prototype.hasOwnProperty;var dn=1,pn="[object Arguments]",hn="[object Array]",gn="[object Object]",vn=Object.prototype.hasOwnProperty;function bn(t,r,n,o,i,a){var u=e(t),s=e(r),c=u?hn:tr(t),l=s?hn:tr(r),f=(c=c==pn?gn:c)==gn,d=(l=l==pn?gn:l)==gn,p=c==l;if(p&&Ht(t)){if(!Ht(r))return!1;u=!0,f=!1}if(p&&!f)return a||(a=new Tr),u||ee(t)?zr(t,r,n,o,i,a):function(t,e,r,n,o,i,a){switch(r){case Qr:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Jr:return!(t.byteLength!=e.byteLength||!i(new Lr(t),new Lr(e)));case Hr:case Vr:case Yr:return B(+t,+e);case Br:return t.name==e.name&&t.message==e.message;case qr:case Zr:return t==e+"";case Rr:var u=Ur;case Xr:var s=n&Wr;if(u||(u=Fr),t.size!=e.size&&!s)return!1;var c=a.get(t);if(c)return c==e;n|=Nr,a.set(t,e);var l=zr(u(t),u(e),n,o,i,a);return a.delete(t),l;case Gr:if(tn)return tn.call(t)==tn.call(e)}return!1}(t,r,c,n,o,i,a);if(!(n&dn)){var h=f&&vn.call(t,"__wrapped__"),g=d&&vn.call(r,"__wrapped__");if(h||g){var v=h?t.value():t,b=g?r.value():r;return a||(a=new Tr),i(v,b,n,o,a)}}return!!p&&(a||(a=new Tr),function(t,e,r,n,o,i){var a=r&ln,u=cn(t),s=u.length;if(s!=cn(e).length&&!a)return!1;for(var c=s;c--;){var l=u[c];if(!(a?l in e:fn.call(e,l)))return!1}var f=i.get(t),d=i.get(e);if(f&&d)return f==e&&d==t;var p=!0;i.set(t,e),i.set(e,t);for(var h=a;++c<s;){var g=t[l=u[c]],v=e[l];if(n)var b=a?n(v,g,l,e,t,i):n(g,v,l,t,e,i);if(!(void 0===b?g===v||o(g,v,r,n,i):b)){p=!1;break}h||(h="constructor"==l)}if(p&&!h){var m=t.constructor,y=e.constructor;m==y||!("constructor"in t)||!("constructor"in e)||"function"==typeof m&&m instanceof m&&"function"==typeof y&&y instanceof y||(p=!1)}return i.delete(t),i.delete(e),p}(t,r,n,o,i,a))}function mn(t,e,r,n,o){return t===e||(null==t||null==e||!g(t)&&!g(e)?t!=t&&e!=e:bn(t,e,r,n,mn,o))}var yn=1,wn=2;function jn(t){return t==t&&!j(t)}function xn(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}function _n(t){var e=function(t){for(var e=fe(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,jn(o)]}return e}(t);return 1==e.length&&e[0][2]?xn(e[0][0],e[0][1]):function(r){return r===t||function(t,e,r,n){var o=r.length,i=o,a=!n;if(null==t)return!i;for(t=Object(t);o--;){var u=r[o];if(a&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<i;){var s=(u=r[o])[0],c=t[s],l=u[1];if(a&&u[2]){if(void 0===c&&!(s in t))return!1}else{var f=new Tr;if(n)var d=n(c,l,s,t,e,f);if(!(void 0===d?mn(l,c,yn|wn,n,f):d))return!1}}return!0}(r,t,e)}}function On(t,e){return null!=t&&e in Object(t)}function Sn(t,r){return null!=t&&function(t,r,n){for(var o=-1,i=(r=dt(r,t)).length,a=!1;++o<i;){var u=ht(r[o]);if(!(a=null!=t&&n(t,u)))break;t=t[u]}return a||++o!=i?a:!!(i=null==t?0:t.length)&&qt(i)&&Rt(u,i)&&(e(t)||Ut(t))}(t,r,On)}var $n=1,An=2;function kn(t){return w(t)?rr(ht(t)):function(t){return function(e){return gt(e,t)}}(t)}function In(t){return"function"==typeof t?t:null==t?he:"object"==typeof t?e(t)?(r=t[0],n=t[1],w(r)&&jn(n)?xn(ht(r),n):function(t){var e=vt(t,r);return void 0===e&&e===n?Sn(t,r):mn(n,e,$n|An)}):_n(t):kn(t);var r,n}function Tn(t,e){var r=-1,n=le(t)?Array(t.length):[];return pe(t,(function(t,o,i){n[++r]=e(t,o,i)})),n}function Pn(t,r){return(e(t)?at:Tn)(t,In(r))}var Dn=Array.prototype.join;function Mn(t,e){return null==t?"":Dn.call(t,e)}var Cn=Kt&&Kt.isRegExp,En=Cn?Zt(Cn):function(t){return g(t)&&"[object RegExp]"==h(t)},zn=30,Ln="...",Un=/\w*$/;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var Fn={};!function(t,e){t.exports=function(){var t=1e3,e=6e4,r=36e5,n="millisecond",o="second",i="minute",a="hour",u="day",s="week",c="month",l="quarter",f="year",d="date",p="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],r=t%100;return"["+t+(e[(r-20)%10]||e[r]||e[0])+"]"}},b=function(t,e,r){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(r)+t},m={s:b,z:function(t){var e=-t.utcOffset(),r=Math.abs(e),n=Math.floor(r/60),o=r%60;return(e<=0?"+":"-")+b(n,2,"0")+":"+b(o,2,"0")},m:function t(e,r){if(e.date()<r.date())return-t(r,e);var n=12*(r.year()-e.year())+(r.month()-e.month()),o=e.clone().add(n,c),i=r-o<0,a=e.clone().add(n+(i?-1:1),c);return+(-(n+(r-o)/(i?o-a:a-o))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:c,y:f,w:s,d:u,D:d,h:a,m:i,s:o,ms:n,Q:l}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},y="en",w={};w[y]=v;var j="$isDayjsObject",x=function(t){return t instanceof $||!(!t||!t[j])},_=function t(e,r,n){var o;if(!e)return y;if("string"==typeof e){var i=e.toLowerCase();w[i]&&(o=i),r&&(w[i]=r,o=i);var a=e.split("-");if(!o&&a.length>1)return t(a[0])}else{var u=e.name;w[u]=e,o=u}return!n&&o&&(y=o),o||!n&&y},O=function(t,e){if(x(t))return t.clone();var r="object"==typeof e?e:{};return r.date=t,r.args=arguments,new $(r)},S=m;S.l=_,S.i=x,S.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var $=function(){function v(t){this.$L=_(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[j]=!0}var b=v.prototype;return b.parse=function(t){this.$d=function(t){var e=t.date,r=t.utc;if(null===e)return new Date(NaN);if(S.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var n=e.match(h);if(n){var o=n[2]-1||0,i=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,i)):new Date(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,i)}}return new Date(e)}(t),this.init()},b.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},b.$utils=function(){return S},b.isValid=function(){return!(this.$d.toString()===p)},b.isSame=function(t,e){var r=O(t);return this.startOf(e)<=r&&r<=this.endOf(e)},b.isAfter=function(t,e){return O(t)<this.startOf(e)},b.isBefore=function(t,e){return this.endOf(e)<O(t)},b.$g=function(t,e,r){return S.u(t)?this[e]:this.set(r,t)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(t,e){var r=this,n=!!S.u(e)||e,l=S.p(t),p=function(t,e){var o=S.w(r.$u?Date.UTC(r.$y,e,t):new Date(r.$y,e,t),r);return n?o:o.endOf(u)},h=function(t,e){return S.w(r.toDate()[t].apply(r.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(e)),r)},g=this.$W,v=this.$M,b=this.$D,m="set"+(this.$u?"UTC":"");switch(l){case f:return n?p(1,0):p(31,11);case c:return n?p(1,v):p(0,v+1);case s:var y=this.$locale().weekStart||0,w=(g<y?g+7:g)-y;return p(n?b-w:b+(6-w),v);case u:case d:return h(m+"Hours",0);case a:return h(m+"Minutes",1);case i:return h(m+"Seconds",2);case o:return h(m+"Milliseconds",3);default:return this.clone()}},b.endOf=function(t){return this.startOf(t,!1)},b.$set=function(t,e){var r,s=S.p(t),l="set"+(this.$u?"UTC":""),p=(r={},r[u]=l+"Date",r[d]=l+"Date",r[c]=l+"Month",r[f]=l+"FullYear",r[a]=l+"Hours",r[i]=l+"Minutes",r[o]=l+"Seconds",r[n]=l+"Milliseconds",r)[s],h=s===u?this.$D+(e-this.$W):e;if(s===c||s===f){var g=this.clone().set(d,1);g.$d[p](h),g.init(),this.$d=g.set(d,Math.min(this.$D,g.daysInMonth())).$d}else p&&this.$d[p](h);return this.init(),this},b.set=function(t,e){return this.clone().$set(t,e)},b.get=function(t){return this[S.p(t)]()},b.add=function(n,l){var d,p=this;n=Number(n);var h=S.p(l),g=function(t){var e=O(p);return S.w(e.date(e.date()+Math.round(t*n)),p)};if(h===c)return this.set(c,this.$M+n);if(h===f)return this.set(f,this.$y+n);if(h===u)return g(1);if(h===s)return g(7);var v=(d={},d[i]=e,d[a]=r,d[o]=t,d)[h]||1,b=this.$d.getTime()+n*v;return S.w(b,this)},b.subtract=function(t,e){return this.add(-1*t,e)},b.format=function(t){var e=this,r=this.$locale();if(!this.isValid())return r.invalidDate||p;var n=t||"YYYY-MM-DDTHH:mm:ssZ",o=S.z(this),i=this.$H,a=this.$m,u=this.$M,s=r.weekdays,c=r.months,l=r.meridiem,f=function(t,r,o,i){return t&&(t[r]||t(e,n))||o[r].slice(0,i)},d=function(t){return S.s(i%12||12,t,"0")},h=l||function(t,e,r){var n=t<12?"AM":"PM";return r?n.toLowerCase():n};return n.replace(g,(function(t,n){return n||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return S.s(e.$y,4,"0");case"M":return u+1;case"MM":return S.s(u+1,2,"0");case"MMM":return f(r.monthsShort,u,c,3);case"MMMM":return f(c,u);case"D":return e.$D;case"DD":return S.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return f(r.weekdaysMin,e.$W,s,2);case"ddd":return f(r.weekdaysShort,e.$W,s,3);case"dddd":return s[e.$W];case"H":return String(i);case"HH":return S.s(i,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return h(i,a,!0);case"A":return h(i,a,!1);case"m":return String(a);case"mm":return S.s(a,2,"0");case"s":return String(e.$s);case"ss":return S.s(e.$s,2,"0");case"SSS":return S.s(e.$ms,3,"0");case"Z":return o}return null}(t)||o.replace(":","")}))},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(n,d,p){var h,g=this,v=S.p(d),b=O(n),m=(b.utcOffset()-this.utcOffset())*e,y=this-b,w=function(){return S.m(g,b)};switch(v){case f:h=w()/12;break;case c:h=w();break;case l:h=w()/3;break;case s:h=(y-m)/6048e5;break;case u:h=(y-m)/864e5;break;case a:h=y/r;break;case i:h=y/e;break;case o:h=y/t;break;default:h=y}return p?h:S.a(h)},b.daysInMonth=function(){return this.endOf(c).$D},b.$locale=function(){return w[this.$L]},b.locale=function(t,e){if(!t)return this.$L;var r=this.clone(),n=_(t,e,!0);return n&&(r.$L=n),r},b.clone=function(){return S.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},v}(),A=$.prototype;return O.prototype=A,[["$ms",n],["$s",o],["$m",i],["$H",a],["$W",u],["$M",c],["$y",f],["$D",d]].forEach((function(t){A[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),O.extend=function(t,e){return t.$i||(t(e,$,O),t.$i=!0),O},O.locale=_,O.isDayjs=x,O.unix=function(t){return O(1e3*t)},O.en=w[y],O.Ls=w,O.p={},O}()}({get exports(){return Fn},set exports(t){Fn=t}});var Wn=Fn;const Nn=[];for(let t=0;t<256;++t)Nn.push((t+256).toString(16).slice(1));const Hn=new Uint8Array(16);function Vn(){return crypto.getRandomValues(Hn)}const Bn={};function Rn(t,e,r){let n;if(t)n=Yn(t.random??t.rng?.()??Vn(),t.msecs,t.seq,e,r);else{const t=Date.now(),o=Vn();!function(t,e,r){t.msecs??=-1/0,t.seq??=0,e>t.msecs?(t.seq=qn(r),t.msecs=e):(t.seq=t.seq+1|0,0===t.seq&&t.msecs++)}(Bn,t,o),n=Yn(o,Bn.msecs,Bn.seq,e,r)}return e??function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(Nn[t[e+0]]+Nn[t[e+1]]+Nn[t[e+2]]+Nn[t[e+3]]+"-"+Nn[t[e+4]]+Nn[t[e+5]]+"-"+Nn[t[e+6]]+Nn[t[e+7]]+"-"+Nn[t[e+8]]+Nn[t[e+9]]+"-"+Nn[t[e+10]]+Nn[t[e+11]]+Nn[t[e+12]]+Nn[t[e+13]]+Nn[t[e+14]]+Nn[t[e+15]]).toLowerCase()}(n)}function Yn(t,e,r,n){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(t.length<16)throw new Error("Random bytes length must be >= 16");if(n){if(o<0||o+16>n.length)throw new RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`)}else n=new Uint8Array(16),o=0;return e??=Date.now(),r??=qn(t),n[o++]=e/1099511627776&255,n[o++]=e/4294967296&255,n[o++]=e/16777216&255,n[o++]=e/65536&255,n[o++]=e/256&255,n[o++]=255&e,n[o++]=112|r>>>28&15,n[o++]=r>>>20&255,n[o++]=128|r>>>14&63,n[o++]=r>>>6&255,n[o++]=r<<2&255|3&t[10],n[o++]=t[11],n[o++]=t[12],n[o++]=t[13],n[o++]=t[14],n[o++]=t[15],n}function qn(t){return(127&t[6])<<24|t[7]<<16|t[8]<<8|t[9]}var Xn=function(){try{var t=F(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Zn=Xn;function Gn(t,e,r){"__proto__"==e&&Zn?Zn(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var Jn=Object.prototype.hasOwnProperty;function Qn(t,e,r){var n=t[e];Jn.call(t,e)&&B(n,r)&&(void 0!==r||e in t)||Gn(t,e,r)}function Kn(t,e,r,n){var o=!r;r||(r={});for(var i=-1,a=e.length;++i<a;){var u=e[i],s=n?n(r[u],t[u],u,r,t):void 0;void 0===s&&(s=t[u]),o?Gn(r,u,s):Qn(r,u,s)}return r}var to=Object.prototype.hasOwnProperty;function eo(t){if(!j(t))return function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}(t);var e=ie(t),r=[];for(var n in t)("constructor"!=n||!e&&to.call(t,n))&&r.push(n);return r}function ro(t){return le(t)?ne(t,!0):eo(t)}var no="object"==typeof exports&&exports&&!exports.nodeType&&exports,oo=no&&"object"==typeof module&&module&&!module.nodeType&&module,io=oo&&oo.exports===no?o.Buffer:void 0,ao=io?io.allocUnsafe:void 0;var uo=ae(Object.getPrototypeOf,Object),so=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)en(e,sn(t)),t=uo(t);return e}:nn,co=so;function lo(t){return rn(t,ro,co)}var fo=Object.prototype.hasOwnProperty;function po(t){var e=new t.constructor(t.byteLength);return new Lr(e).set(new Lr(t)),e}var ho=/\w*$/;var go=i?i.prototype:void 0,vo=go?go.valueOf:void 0;var bo="[object Boolean]",mo="[object Date]",yo="[object Map]",wo="[object Number]",jo="[object RegExp]",xo="[object Set]",_o="[object String]",Oo="[object Symbol]",So="[object ArrayBuffer]",$o="[object DataView]",Ao="[object Float32Array]",ko="[object Float64Array]",Io="[object Int8Array]",To="[object Int16Array]",Po="[object Int32Array]",Do="[object Uint8Array]",Mo="[object Uint8ClampedArray]",Co="[object Uint16Array]",Eo="[object Uint32Array]";function zo(t,e,r){var n,o=t.constructor;switch(e){case So:return po(t);case bo:case mo:return new o(+t);case $o:return function(t,e){var r=e?po(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case Ao:case ko:case Io:case To:case Po:case Do:case Mo:case Co:case Eo:return function(t,e){var r=e?po(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}(t,r);case yo:return new o;case wo:case _o:return new o(t);case jo:return function(t){var e=new t.constructor(t.source,ho.exec(t));return e.lastIndex=t.lastIndex,e}(t);case xo:return new o;case Oo:return n=t,vo?Object(vo.call(n)):{}}}var Lo=Object.create,Uo=function(){function t(){}return function(e){if(!j(e))return{};if(Lo)return Lo(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}(),Fo=Uo;var Wo=Kt&&Kt.isMap,No=Wo?Zt(Wo):function(t){return g(t)&&"[object Map]"==tr(t)};var Ho=Kt&&Kt.isSet,Vo=Ho?Zt(Ho):function(t){return g(t)&&"[object Set]"==tr(t)},Bo=1,Ro=2,Yo=4,qo="[object Arguments]",Xo="[object Function]",Zo="[object GeneratorFunction]",Go="[object Object]",Jo={};function Qo(t,r,n,o,i,a){var u,s=r&Bo,c=r&Ro,l=r&Yo;if(n&&(u=i?n(t,o,i,a):n(t)),void 0!==u)return u;if(!j(t))return t;var f=e(t);if(f){if(u=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&fo.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!s)return function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}(t,u)}else{var d=tr(t),p=d==Xo||d==Zo;if(Ht(t))return function(t,e){if(e)return t.slice();var r=t.length,n=ao?ao(r):new t.constructor(r);return t.copy(n),n}(t,s);if(d==Go||d==qo||p&&!i){if(u=c||p?{}:function(t){return"function"!=typeof t.constructor||ie(t)?{}:Fo(uo(t))}(t),!s)return c?function(t,e){return Kn(t,co(t),e)}(t,function(t,e){return t&&Kn(e,ro(e),t)}(u,t)):function(t,e){return Kn(t,sn(t),e)}(t,function(t,e){return t&&Kn(e,fe(e),t)}(u,t))}else{if(!Jo[d])return i?t:{};u=zo(t,d,s)}}a||(a=new Tr);var h=a.get(t);if(h)return h;a.set(t,u),Vo(t)?t.forEach((function(e){u.add(Qo(e,r,n,e,t,a))})):No(t)&&t.forEach((function(e,o){u.set(o,Qo(e,r,n,o,t,a))}));var g=f?void 0:(l?c?lo:cn:c?ro:fe)(t);return Tt(g||t,(function(e,o){g&&(e=t[o=e]),Qn(u,o,Qo(e,r,n,o,t,a))})),u}Jo[qo]=Jo["[object Array]"]=Jo["[object ArrayBuffer]"]=Jo["[object DataView]"]=Jo["[object Boolean]"]=Jo["[object Date]"]=Jo["[object Float32Array]"]=Jo["[object Float64Array]"]=Jo["[object Int8Array]"]=Jo["[object Int16Array]"]=Jo["[object Int32Array]"]=Jo["[object Map]"]=Jo["[object Number]"]=Jo[Go]=Jo["[object RegExp]"]=Jo["[object Set]"]=Jo["[object String]"]=Jo["[object Symbol]"]=Jo["[object Uint8Array]"]=Jo["[object Uint8ClampedArray]"]=Jo["[object Uint16Array]"]=Jo["[object Uint32Array]"]=!0,Jo["[object Error]"]=Jo[Xo]=Jo["[object WeakMap]"]=!1;var Ko=1,ti=4;var ei={},ri={get exports(){return ei},set exports(t){ei=t}},ni={},oi={},ii={get exports(){return oi},set exports(t){oi=t}},ai={};function ui(){var t={"align-content":!1,"align-items":!1,"align-self":!1,"alignment-adjust":!1,"alignment-baseline":!1,all:!1,"anchor-point":!1,animation:!1,"animation-delay":!1,"animation-direction":!1,"animation-duration":!1,"animation-fill-mode":!1,"animation-iteration-count":!1,"animation-name":!1,"animation-play-state":!1,"animation-timing-function":!1,azimuth:!1,"backface-visibility":!1,background:!0,"background-attachment":!0,"background-clip":!0,"background-color":!0,"background-image":!0,"background-origin":!0,"background-position":!0,"background-repeat":!0,"background-size":!0,"baseline-shift":!1,binding:!1,bleed:!1,"bookmark-label":!1,"bookmark-level":!1,"bookmark-state":!1,border:!0,"border-bottom":!0,"border-bottom-color":!0,"border-bottom-left-radius":!0,"border-bottom-right-radius":!0,"border-bottom-style":!0,"border-bottom-width":!0,"border-collapse":!0,"border-color":!0,"border-image":!0,"border-image-outset":!0,"border-image-repeat":!0,"border-image-slice":!0,"border-image-source":!0,"border-image-width":!0,"border-left":!0,"border-left-color":!0,"border-left-style":!0,"border-left-width":!0,"border-radius":!0,"border-right":!0,"border-right-color":!0,"border-right-style":!0,"border-right-width":!0,"border-spacing":!0,"border-style":!0,"border-top":!0,"border-top-color":!0,"border-top-left-radius":!0,"border-top-right-radius":!0,"border-top-style":!0,"border-top-width":!0,"border-width":!0,bottom:!1,"box-decoration-break":!0,"box-shadow":!0,"box-sizing":!0,"box-snap":!0,"box-suppress":!0,"break-after":!0,"break-before":!0,"break-inside":!0,"caption-side":!1,chains:!1,clear:!0,clip:!1,"clip-path":!1,"clip-rule":!1,color:!0,"color-interpolation-filters":!0,"column-count":!1,"column-fill":!1,"column-gap":!1,"column-rule":!1,"column-rule-color":!1,"column-rule-style":!1,"column-rule-width":!1,"column-span":!1,"column-width":!1,columns:!1,contain:!1,content:!1,"counter-increment":!1,"counter-reset":!1,"counter-set":!1,crop:!1,cue:!1,"cue-after":!1,"cue-before":!1,cursor:!1,direction:!1,display:!0,"display-inside":!0,"display-list":!0,"display-outside":!0,"dominant-baseline":!1,elevation:!1,"empty-cells":!1,filter:!1,flex:!1,"flex-basis":!1,"flex-direction":!1,"flex-flow":!1,"flex-grow":!1,"flex-shrink":!1,"flex-wrap":!1,float:!1,"float-offset":!1,"flood-color":!1,"flood-opacity":!1,"flow-from":!1,"flow-into":!1,font:!0,"font-family":!0,"font-feature-settings":!0,"font-kerning":!0,"font-language-override":!0,"font-size":!0,"font-size-adjust":!0,"font-stretch":!0,"font-style":!0,"font-synthesis":!0,"font-variant":!0,"font-variant-alternates":!0,"font-variant-caps":!0,"font-variant-east-asian":!0,"font-variant-ligatures":!0,"font-variant-numeric":!0,"font-variant-position":!0,"font-weight":!0,grid:!1,"grid-area":!1,"grid-auto-columns":!1,"grid-auto-flow":!1,"grid-auto-rows":!1,"grid-column":!1,"grid-column-end":!1,"grid-column-start":!1,"grid-row":!1,"grid-row-end":!1,"grid-row-start":!1,"grid-template":!1,"grid-template-areas":!1,"grid-template-columns":!1,"grid-template-rows":!1,"hanging-punctuation":!1,height:!0,hyphens:!1,icon:!1,"image-orientation":!1,"image-resolution":!1,"ime-mode":!1,"initial-letters":!1,"inline-box-align":!1,"justify-content":!1,"justify-items":!1,"justify-self":!1,left:!1,"letter-spacing":!0,"lighting-color":!0,"line-box-contain":!1,"line-break":!1,"line-grid":!1,"line-height":!1,"line-snap":!1,"line-stacking":!1,"line-stacking-ruby":!1,"line-stacking-shift":!1,"line-stacking-strategy":!1,"list-style":!0,"list-style-image":!0,"list-style-position":!0,"list-style-type":!0,margin:!0,"margin-bottom":!0,"margin-left":!0,"margin-right":!0,"margin-top":!0,"marker-offset":!1,"marker-side":!1,marks:!1,mask:!1,"mask-box":!1,"mask-box-outset":!1,"mask-box-repeat":!1,"mask-box-slice":!1,"mask-box-source":!1,"mask-box-width":!1,"mask-clip":!1,"mask-image":!1,"mask-origin":!1,"mask-position":!1,"mask-repeat":!1,"mask-size":!1,"mask-source-type":!1,"mask-type":!1,"max-height":!0,"max-lines":!1,"max-width":!0,"min-height":!0,"min-width":!0,"move-to":!1,"nav-down":!1,"nav-index":!1,"nav-left":!1,"nav-right":!1,"nav-up":!1,"object-fit":!1,"object-position":!1,opacity:!1,order:!1,orphans:!1,outline:!1,"outline-color":!1,"outline-offset":!1,"outline-style":!1,"outline-width":!1,overflow:!1,"overflow-wrap":!1,"overflow-x":!1,"overflow-y":!1,padding:!0,"padding-bottom":!0,"padding-left":!0,"padding-right":!0,"padding-top":!0,page:!1,"page-break-after":!1,"page-break-before":!1,"page-break-inside":!1,"page-policy":!1,pause:!1,"pause-after":!1,"pause-before":!1,perspective:!1,"perspective-origin":!1,pitch:!1,"pitch-range":!1,"play-during":!1,position:!1,"presentation-level":!1,quotes:!1,"region-fragment":!1,resize:!1,rest:!1,"rest-after":!1,"rest-before":!1,richness:!1,right:!1,rotation:!1,"rotation-point":!1,"ruby-align":!1,"ruby-merge":!1,"ruby-position":!1,"shape-image-threshold":!1,"shape-outside":!1,"shape-margin":!1,size:!1,speak:!1,"speak-as":!1,"speak-header":!1,"speak-numeral":!1,"speak-punctuation":!1,"speech-rate":!1,stress:!1,"string-set":!1,"tab-size":!1,"table-layout":!1,"text-align":!0,"text-align-last":!0,"text-combine-upright":!0,"text-decoration":!0,"text-decoration-color":!0,"text-decoration-line":!0,"text-decoration-skip":!0,"text-decoration-style":!0,"text-emphasis":!0,"text-emphasis-color":!0,"text-emphasis-position":!0,"text-emphasis-style":!0,"text-height":!0,"text-indent":!0,"text-justify":!0,"text-orientation":!0,"text-overflow":!0,"text-shadow":!0,"text-space-collapse":!0,"text-transform":!0,"text-underline-position":!0,"text-wrap":!0,top:!1,transform:!1,"transform-origin":!1,"transform-style":!1,transition:!1,"transition-delay":!1,"transition-duration":!1,"transition-property":!1,"transition-timing-function":!1,"unicode-bidi":!1,"vertical-align":!1,visibility:!1,"voice-balance":!1,"voice-duration":!1,"voice-family":!1,"voice-pitch":!1,"voice-range":!1,"voice-rate":!1,"voice-stress":!1,"voice-volume":!1,volume:!1,"white-space":!1,widows:!1,width:!0,"will-change":!1,"word-break":!0,"word-spacing":!0,"word-wrap":!0,"wrap-flow":!1,"wrap-through":!1,"writing-mode":!1,"z-index":!1};return t}var si=/javascript\s*\:/gim;ai.whiteList=ui(),ai.getDefaultWhiteList=ui,ai.onAttr=function(t,e,r){},ai.onIgnoreAttr=function(t,e,r){},ai.safeAttrValue=function(t,e){return si.test(e)?"":e};var ci={indexOf:function(t,e){var r,n;if(Array.prototype.indexOf)return t.indexOf(e);for(r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1},forEach:function(t,e,r){var n,o;if(Array.prototype.forEach)return t.forEach(e,r);for(n=0,o=t.length;n<o;n++)e.call(r,t[n],n,t)},trim:function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(t){return String.prototype.trimRight?t.trimRight():t.replace(/(\s*$)/g,"")}};var li=function(t,e){";"!==(t=ci.trimRight(t))[t.length-1]&&(t+=";");var r=t.length,n=!1,o=0,i=0,a="";function u(){if(!n){var r=ci.trim(t.slice(o,i)),u=r.indexOf(":");if(-1!==u){var s=ci.trim(r.slice(0,u)),c=ci.trim(r.slice(u+1));if(s){var l=e(o,a.length,s,c,r);l&&(a+=l+"; ")}}}o=i+1}for(;i<r;i++){var s=t[i];if("/"===s&&"*"===t[i+1]){var c=t.indexOf("*/",i+2);if(-1===c)break;o=(i=c+1)+1,n=!1}else"("===s?n=!0:")"===s?n=!1:";"===s?n||u():"\n"===s&&u()}return ci.trim(a)},fi=ai,di=li;function pi(t){return null==t}function hi(t){(t=function(t){var e={};for(var r in t)e[r]=t[r];return e}(t||{})).whiteList=t.whiteList||fi.whiteList,t.onAttr=t.onAttr||fi.onAttr,t.onIgnoreAttr=t.onIgnoreAttr||fi.onIgnoreAttr,t.safeAttrValue=t.safeAttrValue||fi.safeAttrValue,this.options=t}hi.prototype.process=function(t){if(!(t=(t=t||"").toString()))return"";var e=this.options,r=e.whiteList,n=e.onAttr,o=e.onIgnoreAttr,i=e.safeAttrValue;return di(t,(function(t,e,a,u,s){var c=r[a],l=!1;if(!0===c?l=c:"function"==typeof c?l=c(u):c instanceof RegExp&&(l=c.test(u)),!0!==l&&(l=!1),u=i(a,u)){var f,d={position:e,sourcePosition:t,source:s,isWhite:l};return l?pi(f=n(a,u,d))?a+":"+u:f:pi(f=o(a,u,d))?void 0:f}}))};var gi=hi;!function(t,e){var r=ai,n=gi;for(var o in(e=t.exports=function(t,e){return new n(e).process(t)}).FilterCSS=n,r)e[o]=r[o];"undefined"!=typeof window&&(window.filterCSS=t.exports)}(ii,oi);var vi={indexOf:function(t,e){var r,n;if(Array.prototype.indexOf)return t.indexOf(e);for(r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1},forEach:function(t,e,r){var n,o;if(Array.prototype.forEach)return t.forEach(e,r);for(n=0,o=t.length;n<o;n++)e.call(r,t[n],n,t)},trim:function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(t){var e=/\s|\n|\t/.exec(t);return e?e.index:-1}},bi=oi.FilterCSS,mi=oi.getDefaultWhiteList,yi=vi;function wi(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var ji=new bi;function xi(t){return t.replace(_i,"&lt;").replace(Oi,"&gt;")}var _i=/</g,Oi=/>/g,Si=/"/g,$i=/&quot;/g,Ai=/&#([a-zA-Z0-9]*);?/gim,ki=/&colon;?/gim,Ii=/&newline;?/gim,Ti=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,Pi=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,Di=/u\s*r\s*l\s*\(.*/gi;function Mi(t){return t.replace(Si,"&quot;")}function Ci(t){return t.replace($i,'"')}function Ei(t){return t.replace(Ai,(function(t,e){return"x"===e[0]||"X"===e[0]?String.fromCharCode(parseInt(e.substr(1),16)):String.fromCharCode(parseInt(e,10))}))}function zi(t){return t.replace(ki,":").replace(Ii," ")}function Li(t){for(var e="",r=0,n=t.length;r<n;r++)e+=t.charCodeAt(r)<32?" ":t.charAt(r);return yi.trim(e)}function Ui(t){return t=Li(t=zi(t=Ei(t=Ci(t))))}function Fi(t){return t=xi(t=Mi(t))}ni.whiteList={a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]},ni.getDefaultWhiteList=wi,ni.onTag=function(t,e,r){},ni.onIgnoreTag=function(t,e,r){},ni.onTagAttr=function(t,e,r){},ni.onIgnoreTagAttr=function(t,e,r){},ni.safeAttrValue=function(t,e,r,n){if(r=Ui(r),"href"===e||"src"===e){if("#"===(r=yi.trim(r)))return"#";if("http://"!==r.substr(0,7)&&"https://"!==r.substr(0,8)&&"mailto:"!==r.substr(0,7)&&"tel:"!==r.substr(0,4)&&"data:image/"!==r.substr(0,11)&&"ftp://"!==r.substr(0,6)&&"./"!==r.substr(0,2)&&"../"!==r.substr(0,3)&&"#"!==r[0]&&"/"!==r[0])return""}else if("background"===e){if(Ti.lastIndex=0,Ti.test(r))return""}else if("style"===e){if(Pi.lastIndex=0,Pi.test(r))return"";if(Di.lastIndex=0,Di.test(r)&&(Ti.lastIndex=0,Ti.test(r)))return"";!1!==n&&(r=(n=n||ji).process(r))}return r=Fi(r)},ni.escapeHtml=xi,ni.escapeQuote=Mi,ni.unescapeQuote=Ci,ni.escapeHtmlEntities=Ei,ni.escapeDangerHtml5Entities=zi,ni.clearNonPrintableCharacter=Li,ni.friendlyAttrValue=Ui,ni.escapeAttrValue=Fi,ni.onIgnoreTagStripAll=function(){return""},ni.StripTagBody=function(t,e){"function"!=typeof e&&(e=function(){});var r=!Array.isArray(t),n=[],o=!1;return{onIgnoreTag:function(i,a,u){if(function(e){return!!r||-1!==yi.indexOf(t,e)}(i)){if(u.isClosing){var s="[/removed]",c=u.position+s.length;return n.push([!1!==o?o:u.position,c]),o=!1,s}return o||(o=u.position),"[removed]"}return e(i,a,u)},remove:function(t){var e="",r=0;return yi.forEach(n,(function(n){e+=t.slice(r,n[0]),r=n[1]})),e+=t.slice(r)}}},ni.stripCommentTag=function(t){for(var e="",r=0;r<t.length;){var n=t.indexOf("\x3c!--",r);if(-1===n){e+=t.slice(r);break}e+=t.slice(r,n);var o=t.indexOf("--\x3e",n);if(-1===o)break;r=o+3}return e},ni.stripBlankChar=function(t){var e=t.split("");return(e=e.filter((function(t){var e=t.charCodeAt(0);return 127!==e&&(!(e<=31)||(10===e||13===e))}))).join("")},ni.attributeWrapSign='"',ni.cssFilter=ji,ni.getDefaultCSSWhiteList=mi;var Wi={},Ni=vi;function Hi(t){var e,r=Ni.spaceIndex(t);return e=-1===r?t.slice(1,-1):t.slice(1,r+1),"/"===(e=Ni.trim(e).toLowerCase()).slice(0,1)&&(e=e.slice(1)),"/"===e.slice(-1)&&(e=e.slice(0,-1)),e}function Vi(t){return"</"===t.slice(0,2)}var Bi=/[^a-zA-Z0-9\\_:.-]/gim;function Ri(t,e){for(;e<t.length;e++){var r=t[e];if(" "!==r)return"="===r?e:-1}}function Yi(t,e){for(;e<t.length;e++){var r=t[e];if(" "!==r)return"'"===r||'"'===r?e:-1}}function qi(t,e){for(;e>0;e--){var r=t[e];if(" "!==r)return"="===r?e:-1}}function Xi(t){return function(t){return'"'===t[0]&&'"'===t[t.length-1]||"'"===t[0]&&"'"===t[t.length-1]}(t)?t.substr(1,t.length-2):t}Wi.parseTag=function(t,e,r){var n="",o=0,i=!1,a=!1,u=0,s=t.length,c="",l="";t:for(u=0;u<s;u++){var f=t.charAt(u);if(!1===i){if("<"===f){i=u;continue}}else if(!1===a){if("<"===f){n+=r(t.slice(o,u)),i=u,o=u;continue}if(">"===f||u===s-1){n+=r(t.slice(o,i)),c=Hi(l=t.slice(i,u+1)),n+=e(i,n.length,c,l,Vi(l)),o=u+1,i=!1;continue}if('"'===f||"'"===f)for(var d=1,p=t.charAt(u-d);""===p.trim()||"="===p;){if("="===p){a=f;continue t}p=t.charAt(u-++d)}}else if(f===a){a=!1;continue}}return o<s&&(n+=r(t.substr(o))),n},Wi.parseAttr=function(t,e){var r=0,n=0,o=[],i=!1,a=t.length;function u(t,r){if(!((t=(t=Ni.trim(t)).replace(Bi,"").toLowerCase()).length<1)){var n=e(t,r||"");n&&o.push(n)}}for(var s=0;s<a;s++){var c,l=t.charAt(s);if(!1!==i||"="!==l)if(!1===i||s!==n)if(/\s|\n|\t/.test(l)){if(t=t.replace(/\s|\n|\t/g," "),!1===i){if(-1===(c=Ri(t,s))){u(Ni.trim(t.slice(r,s))),i=!1,r=s+1;continue}s=c-1;continue}if(-1===(c=qi(t,s-1))){u(i,Xi(Ni.trim(t.slice(r,s)))),i=!1,r=s+1;continue}}else;else{if(-1===(c=t.indexOf(l,s+1)))break;u(i,Ni.trim(t.slice(n+1,c))),i=!1,r=(s=c)+1}else i=t.slice(r,s),r=s+1,n='"'===t.charAt(r)||"'"===t.charAt(r)?r:Yi(t,s+1)}return r<t.length&&(!1===i?u(t.slice(r)):u(i,Xi(Ni.trim(t.slice(r))))),Ni.trim(o.join(" "))};var Zi=oi.FilterCSS,Gi=ni,Ji=Wi,Qi=Ji.parseTag,Ki=Ji.parseAttr,ta=vi;function ea(t){return null==t}function ra(t){(t=function(t){var e={};for(var r in t)e[r]=t[r];return e}(t||{})).stripIgnoreTag&&(t.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),t.onIgnoreTag=Gi.onIgnoreTagStripAll),t.whiteList||t.allowList?t.whiteList=function(t){var e={};for(var r in t)Array.isArray(t[r])?e[r.toLowerCase()]=t[r].map((function(t){return t.toLowerCase()})):e[r.toLowerCase()]=t[r];return e}(t.whiteList||t.allowList):t.whiteList=Gi.whiteList,this.attributeWrapSign=!0===t.singleQuotedAttributeValue?"'":Gi.attributeWrapSign,t.onTag=t.onTag||Gi.onTag,t.onTagAttr=t.onTagAttr||Gi.onTagAttr,t.onIgnoreTag=t.onIgnoreTag||Gi.onIgnoreTag,t.onIgnoreTagAttr=t.onIgnoreTagAttr||Gi.onIgnoreTagAttr,t.safeAttrValue=t.safeAttrValue||Gi.safeAttrValue,t.escapeHtml=t.escapeHtml||Gi.escapeHtml,this.options=t,!1===t.css?this.cssFilter=!1:(t.css=t.css||{},this.cssFilter=new Zi(t.css))}ra.prototype.process=function(t){if(!(t=(t=t||"").toString()))return"";var e=this,r=e.options,n=r.whiteList,o=r.onTag,i=r.onIgnoreTag,a=r.onTagAttr,u=r.onIgnoreTagAttr,s=r.safeAttrValue,c=r.escapeHtml,l=e.attributeWrapSign,f=e.cssFilter;r.stripBlankChar&&(t=Gi.stripBlankChar(t)),r.allowCommentTag||(t=Gi.stripCommentTag(t));var d=!1;r.stripIgnoreTagBody&&(d=Gi.StripTagBody(r.stripIgnoreTagBody,i),i=d.onIgnoreTag);var p=Qi(t,(function(t,e,r,d,p){var h={sourcePosition:t,position:e,isClosing:p,isWhite:Object.prototype.hasOwnProperty.call(n,r)},g=o(r,d,h);if(!ea(g))return g;if(h.isWhite){if(h.isClosing)return"</"+r+">";var v=function(t){var e=ta.spaceIndex(t);if(-1===e)return{html:"",closing:"/"===t[t.length-2]};var r="/"===(t=ta.trim(t.slice(e+1,-1)))[t.length-1];return r&&(t=ta.trim(t.slice(0,-1))),{html:t,closing:r}}(d),b=n[r],m=Ki(v.html,(function(t,e){var n=-1!==ta.indexOf(b,t),o=a(r,t,e,n);return ea(o)?n?(e=s(r,t,e,f))?t+"="+l+e+l:t:ea(o=u(r,t,e,n))?void 0:o:o}));return d="<"+r,m&&(d+=" "+m),v.closing&&(d+=" /"),d+=">"}return ea(g=i(r,d,h))?c(d):g}),c);return d&&(p=d.remove(p)),p};var na=ra;!function(t,e){var r=ni,n=Wi,o=na;function i(t,e){return new o(e).process(t)}(e=t.exports=i).filterXSS=i,e.FilterXSS=o,function(){for(var t in r)e[t]=r[t];for(var o in n)e[o]=n[o]}(),"undefined"!=typeof window&&(window.filterXSS=t.exports),"undefined"!=typeof self&&"undefined"!=typeof DedicatedWorkerGlobalScope&&self instanceof DedicatedWorkerGlobalScope&&(self.filterXSS=t.exports)}(ri,ei);var oa=ei;function ia(){return"undefined"!=typeof self?self:"undefined"!=typeof window&&void 0!==window.document?window:"undefined"!=typeof global?global:null}let aa=/<(?=[A-Za-z!/?]|$)/g;function ua(t){return t.replace(aa,"&lt;")}let sa={getFilterXSS:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:oa;if(me(t))return t;let e=ia(),r=vt(e,"filterXSS",null);if(me(r))return r;let n=vt(e,"xss",null);if(me(n))return n;throw new Error("invalid filterXSS, g.filterXSS, use script for import")},getOpt:function(t){return{escapeHtml:ua,onIgnoreTagAttr:function(e,r,n,o){if("style"===r)return r+'="'+t.escapeAttrValue(n)+'"'}}}};function ca(t){let e=null,r=null;let n=function t(n){return ve(n)||be(n)?(ge(n,(function(e,r){n[r]=t(e)})),n):Sr(n)?(o=n,null===e&&(e=sa.getFilterXSS(),r=sa.getOpt(e)),e(o,r)):n;var o}(Qo(t,Ko|ti));return n}function la(t,e){if(!ve(t))return[];ve(e)||(e=[e]);let r=[];return ge(t,((t,n)=>{0===vt(t,"ok")&&r.push({k:n,id:vt(e,[n,"id"]),err:vt(t,"err","")})})),r}function fa(t,e){let r=Pn((o=10,(n=e)&&n.length?bt(n,0,(o=i||void 0===o?1:It(o))<0?0:o):[]),(t=>Sr(t.id)||$r(t.id)?`id[${function(t,e){var r=zn,n=Ln;if(j(e)){var o="separator"in e?e.separator:o;r="length"in e?It(e.length):r,n="omission"in e?lt(e.omission):n}var i=(t=ft(t)).length;if(Oe(t)){var a=Le(t);i=a.length}if(r>=i)return t;var u=r-vr(n);if(u<1)return n;var s=a?we(a,0,u).join(""):t.slice(0,u);if(void 0===o)return s+n;if(a&&(u+=s.length-u),En(o)){if(t.slice(u).search(o)){var c,l=s;for(o.global||(o=RegExp(o.source,ft(Un.exec(o))+"g")),o.lastIndex=0;c=o.exec(l);)var f=c.index;s=s.slice(0,void 0===f?u:f)}}else if(t.indexOf(lt(o),u)!=u){var d=s.lastIndexOf(o);d>-1&&(s=s.slice(0,d))}return s+n}(String(t.id),{length:100,omission:"…"})}]`:`data[${t.k}]`));var n,o,i;let a=`${t}: ${Mn(r,", ")}`;return yr(e)>10&&(a+=`, ... (${yr(e)} in total)`),a}function da(t){let e=[];return ge(ve(t)?t:[t],((t,r)=>{let n=vt(t,"id");Sr(n)&&ca(n)!==n&&e.push({k:r,id:n})})),e}function pa(t,e){return fa(`${t}, id contains HTML markup`,Pn(e,(t=>({k:t.k}))))}function ha(t,e,r,n){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"save";if(!jr(t))throw console.log("ds",t),new Error("invalid ds");let i=t[e].keys,a=!1;ve(n)||(a=!0,n=[n]);let u=function(){if(!me(Wn))throw new Error("invalid dayjs");return Wn().format("YYYY-MM-DDTHH:mm:ss.SSSZ")}();return o.indexOf("insert")>=0&&(i.indexOf("userId")>=0&&ge(n,((t,e)=>{n[e].userId=r})),i.indexOf("timeCreate")>=0&&ge(n,((t,e)=>{n[e].timeCreate=u})),i.indexOf("userIdUpdate")>=0&&ge(n,((t,e)=>{n[e].userIdUpdate=r})),i.indexOf("timeUpdate")>=0&&ge(n,((t,e)=>{n[e].timeUpdate=u}))),(o.indexOf("insert")>=0||o.indexOf("save")>=0)&&(i.indexOf("userIdUpdate")>=0&&ge(n,((t,e)=>{n[e].userIdUpdate=r})),i.indexOf("timeUpdate")>=0&&ge(n,((t,e)=>{n[e].timeUpdate=u}))),n=Pn(n,((t,e)=>{let r={};return ge(t,((t,e)=>{t=ca(t),r[e]=t})),r})),function(t,e){if(e.indexOf("id")<0)return!1;let r=vt(t,"settings",null);if(jr(r)&&!0!==vt(r,"id.pk"))return!1;let n=vt(r,"id.type","")||vt(t,"kpType.id","");return!(Sr(n)&&["STRING","TEXT","CHAR","UUID","CITEXT"].indexOf(n.toUpperCase())<0)}(t[e],i)&&ge(n,(t=>{yr(t)>0&&!Sr(t.id)&&!$r(t.id)&&(t.id=Rn())})),n=a?n[0]:n}function ga(t,e){return async(r,n,o,i)=>async function(t,e,r,n,o,i){let a,u=null;if(!jr(e))return Promise.reject("invalid woItems");let s=vt(e,n,null);if(null===s)return Promise.reject(`can not find table[${n}] in ORM`);if("select"===o){if(a=await s.select(i).catch((t=>{console.log(`${n}.select catch`,t),u="failed to select data"})),Sr(u))return Promise.reject(u)}else if("insert"===o||"save"===o){let e=i,c=da(i);if(yr(c)>0)return console.log(`${n}.${o} id changed by clearXSS`,c),Promise.reject(pa("insert"===o?"failed to insert data":"failed to save data",c));try{i=ha(t,n,r,i,o)}catch(t){return console.log(`${n}.adjustData catch`,t.toString()),u="failed to adjust data",Promise.reject(u)}if("insert"===o?a=await s.insert(i).catch((t=>{console.log(`${n}.insert catch`,t),u="failed to insert data"})):"save"===o&&(a=await s.save(i).catch((t=>{console.log(`${n}.save catch`,t),u="failed to save data"}))),Sr(u))return Promise.reject(u);if("save"===o){let t=la(a,i);if(yr(t)>0)return console.log(`${n}.save fail`,t),Promise.reject(fa("failed to save data",la(a,e)))}a=ve(i)?Pn(i,(t=>({id:t.id}))):{id:i.id}}else if("del"===o){if(a=await s.del(i).catch((t=>{console.log(`${n}.del catch`,t),u="failed to delete data"})),!Sr(u)){let t=la(a,i);yr(t)>0&&(console.log(`${n}.del fail`,t),u=fa("failed to delete data",t))}}else if("delAll"===o)a=await s.delAll(i).catch((t=>{console.log(`${n}.delAll catch`,t),u="failed to delete data"}));else if("mix"===o){if(!jr(i))return Promise.reject("invalid input of mix, need the result object of ltdtDiffByKey");let e,o=[];for(let[t,e]of[["add","failed to insert data"],["diff","failed to update data"]]){let r=da(vt(i,t,[]));yr(r)>0&&(console.log(`${n}.mix ${t} id changed by clearXSS`,r),o.push(pa(e,r)))}if(yr(o)>0)return Promise.reject(Mn(o,"; "));a=[];let c=[],l=vt(i,"add",[]);if(yr(l)>0){try{l=ha(t,n,r,l,"insert+save")}catch(t){return console.log(`${n}.adjustData catch`,t.toString()),u="failed to adjust data",Promise.reject(u)}if(await s.insert(l).catch((t=>{console.log(`${n}.insert catch`,t),u="failed to insert data"})),Sr(u))return Promise.reject(u);e=Pn(l,(t=>({id:t.id}))),a=[...a,...e]}let f=vt(i,"del",[]);if(yr(f)>0){let t=await s.del(f).catch((t=>{console.log(`${n}.del catch`,t),u="failed to delete data"}));if(Sr(u))return Promise.reject(u);let r=la(t,f);yr(r)>0&&(console.log(`${n}.del fail`,r),c.push(fa("failed to delete data",r))),e=Pn(f,(t=>({id:t.id}))),a=[...a,...e]}let d=vt(i,"diff",[]);if(yr(d)>0){let o=d;try{d=ha(t,n,r,d)}catch(t){return console.log(`${n}.adjustData catch`,t.toString()),u="failed to adjust data",Promise.reject(u)}let i=await s.save(d).catch((t=>{console.log(`${n}.save catch`,t),u="failed to update data"}));if(Sr(u))return Promise.reject(u);let l=la(i,d);yr(l)>0&&(console.log(`${n}.save fail`,l),c.push(fa("failed to update data",la(i,o)))),e=Pn(d,(t=>({id:t.id}))),a=[...a,...e]}if(yr(c)>0)return Promise.reject(Mn(c,"; "))}else u=`invalid mode: ${o}`;return Sr(u)?Promise.reject(u):a}(t,e,r,n,o,i)}function va(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!me(e)){let o=`${r} needs a function, but got ${typeof e}`;throw n&&t.push((()=>Promise.reject(o))),new Error(o)}setTimeout((()=>{t.push(e)}),1)}function ba(t){if(!me(t))return Promise.reject("invalid mapOrm");let e={funChecks:[],funPreProcessing:[],funPostProcessing:[],mapOrm:t};return{addFunCheck:t=>{va(e.funChecks,t,"addFunCheck",!0)},addFunPreProcessing:t=>{va(e.funPreProcessing,t,"addFunPreProcessing")},addFunPostProcessing:t=>{va(e.funPostProcessing,t,"addFunPostProcessing")},procOrm:async(t,r,n,o)=>async function(t,e,r,n,o){if(!me(t.mapOrm))return Promise.reject("invalid mapOrm");await ye(t.funChecks,(t=>t({woName:r,userId:e,mode:n,input:o})));for(let i of[...t.funPreProcessing]){let t=await i({woName:r,userId:e,mode:n,input:o});if(!jr(t)||void 0===t.input)return Promise.reject("invalid return of pre-processing, need an object with input");o=t.input}let i=await t.mapOrm(e,r,n,o);for(let a of[...t.funPostProcessing])i=await a({woName:r,userId:e,mode:n,input:o,output:i});return i}(e,t,r,n,o)}}return function(t,e,r,n){!function(t){let e="procOrm does not authorize users, authorize where procOrm is exposed to clients",r=[["useCheckUser",e],["getUserById",e],["useExcludeWhenNotAdmin","procOrm does not filter select results by user, use addFunPostProcessing if needed"]];for(let[e,n]of r){let r=vt(t,e);if(null!=r&&!1!==r)throw new Error(`opt.${e} has been removed, ${n}`)}}(arguments.length>4&&void 0!==arguments[4]?arguments[4]:{});let o=function(t,e,r,n){if(!jr(t))throw console.log("ds",t),new Error("invalid ds");if(!me(e))throw console.log("WOrm",e),new Error("invalid WOrm");if(!Sr(r))throw console.log("url",r),new Error("invalid url");if(!Sr(n))throw console.log("db",n),new Error("invalid db");let o={};return ge(fe(t),(t=>{let i=new e({url:r,db:n,cl:t});o[t]=i})),o}(t,e,r,n),i=ba(ga(t,o));return{...Ir,woItems:o,closeAll:async()=>{await ye(o,(async t=>{t&&me(t.close)&&await t.close()}))},...i}}}));
7
7
  //# sourceMappingURL=w-serv-orm.umd.js.map