gzjs-utils 1.0.2
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/LICENSE +21 -0
- package/lib/index.js +1 -0
- package/package.json +22 -0
- package/types/index.d.ts +15 -0
- package/types/utils/Base64.d.ts +34 -0
- package/types/utils/Bytes.d.ts +65 -0
- package/types/utils/Env.d.ts +33 -0
- package/types/utils/MD5.d.ts +15 -0
- package/types/utils/RTCHttpClient.d.ts +86 -0
- package/types/utils/Utils.d.ts +258 -0
- package/types/utils/WebRTCIP.d.ts +18 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 惜~缘
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/lib/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("JsUtils",[],e):"object"==typeof exports?exports.JsUtils=e():t.JsUtils=e()}(this,(()=>(()=>{var t={22:function(t,e,r){"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function o(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach((function(e){f(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function a(t,e){if(t){if("string"==typeof t)return u(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(t,e):void 0}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,d(n.key),n)}}function l(t,e,r){return e&&s(t.prototype,e),r&&s(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function f(t,e,r){return(e=d(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function d(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}var p=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.RLY_Core=e.RlyConfigDefinitions=void 0,e.newInstance=function(t,e){e&&(P=e);var r=new w;return r.init=I.bind(r),r.init(t,P),(0,g.defineProps)(t,"__getter__VUE_RLY__"+r.getId(),{value:r,configurable:!1,enumerable:!1,writable:!1}),r};var y=p(r(895)),v=p(r(283)),h=p(r(917)),b=p(r(690)),m=r(981),g=r(656),A=function(t){return(t<10?"0":"")+t},_=function(){return l((function t(e){c(this,t),f(this,"store",void 0);var r={};this.store={setItem:function(t,e){r[t]=e},getItem:function(t){return r[t]},removeItem:function(t){delete r[t]}};var n="z726C792D6A73";if("undefined"!=typeof localStorage){var i=n+"-test";localStorage.setItem(i,i),localStorage.getItem(i)==i&&(localStorage.removeItem(i),this.store=localStorage)}e&&(0,g.defineProps)(e,n,{value:this.store,enumerable:!1,configurable:!1,writable:!1})}),[{key:"setItem",value:function(t,e){e=JSON.stringify(e),this.store.setItem(JSON.stringify(t),h.default.str2hex(e))}},{key:"getItem",value:function(t){try{var e=this.store.getItem(JSON.stringify(t));return e?JSON.parse(h.default.hex2str(e)):e}catch(t){return null}}},{key:"removeItem",value:function(t){return this.store.removeItem(JSON.stringify(t))}}])}();e.RlyConfigDefinitions={"rly-protocol":{values:"http",description:"表示使用 http 协议调用 rly,默认https"},"rly-mock-dev-console":{values:!0,description:"模拟开发,打开控制台 操作 提醒"},"rly-mock-dev":{values:!0,description:"开发环境是否模拟调用"},"rly-nostore-dev":{values:!0,description:"开发环境是否模拟调用"},"rly-log-show":{values:!1,description:"rly运行时是否打印日志"},"rly-log-req":{values:!1,description:"rly运行时是打印请求信息"},"rly-log-rsp":{values:!1,description:"rly运行时是打印相应信息"},"rly-auth-url":{values:"http://127.0.0.1",description:"鉴权地址"},"rly-kname":{values:"APP_ID",description:"动态设置appKey字段信息 指定 appId 值绑定在 appId参数上"},"rly-cl-envs":{values:"APP_SECRET_KEY",description:"清除环境变量,rly-cl-envs=APP_SECRET_KEY&"},"rly-emit-on-init":{values:!0,description:"rly 初始化时是否直接 emit 事件"}},Object.entries(e.RlyConfigDefinitions).forEach((function(t){var e,r,n=(r=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,u=[],c=!0,s=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){s=!0,i=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return u}}(e,r)||a(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=n[0],o=n[1];(0,g.defineProps)(o,"getKey",{value:function(){return i},configurable:!1,writable:!1,enumerable:!1})}));var w=function(){return l((function t(){c(this,t),f(this,"id",void 0),f(this,"dcfg",void 0),f(this,"cfgDefinition",void 0),this.id=y.default.random(8)}),[{key:"init",value:function(t,e){return this}},{key:"getId",value:function(){return this.id}},{key:"getClientId",value:function(){}}])}();e.RLY_Core=w,w.prototype._st_={};var I=function(t,e){var r=this;t||(t=Math),(0,g.defineProps)(t,"__getter__rlyenvs",{value:{NODE_ENV:"production",APP_SECRET_KEY:"prod-preview",appId:null},configurable:!1,enumerable:!1,writable:!1});var n=(0,m.getEnvironments)();"undefined"!=typeof process&&Object.entries(o(o({},t.__getter__rlyenvs),(0,m.getEnvironments)())||{}).forEach((function(t){n[t[0]]=t[1]}));var i,u,c,s,l=new _(t),d=new Date,p=A(d.getFullYear()),I=A(d.getMonth()+1),P=A(d.getDate()),O=function(t){return b.default.encode("726C792D6A73-"+t)};i=y.default.isLeapYear(1*p),s=0==(c=0==(u=1*P-1)?1*I-1:1*I)?1*p-1:1*p,c=A(0==c?12:c),u=A(0==u?i?28:29:u),l.removeItem(O(s+c+u));var S,j,E=(S=Math).__getter__wd?S.__getter__wd:"undefined"!=typeof window?((0,g.defineProps)(S,"__getter__wd",{value:window,configurable:!1,enumerable:!1,writable:!1}),window):((0,g.defineProps)(S,"__getter__wd",{value:{location:{}},configurable:!1,enumerable:!1,writable:!1}),S.__getter__wd),F=console,k=function(t){return h.default.hex2str(t)},C=function(t){return y.default.trim(t)},N=E.xb64={d:v.default.decode,e:v.default.encode},D=function(t){return N.d(t)},x=function(t){return N.e(t)},Y="QVBQX1NFQ1JFVF9LRVk=",R=!1,T=D(Y),M="undefined"!=typeof document&&document,V="Ym9keQ==",B="aW5uZXJIVE1M",J="d2luZG93Lm9wZW4oImFib3V0OmJsYW5rIiwiX3NlbGYiKTsKd2luZG93LmNsb3NlKCk7",W="c2NyaXB0",Z="cmVhZHlTdGF0ZQ==",U="Tk9ERV9FTlY=",L="cHJvZHVjdGlvbg==",G="ZGV2",X="ZGV2ZWxvcA==",$="ZGV2ZWxvcG1lbnQ=",H="aHR0cA==",Q="__getter_VUE_VITE_APP_RLY_TIME_"+b.default.encode(x("$__rly__")),K="undefined"!=typeof navigator&&navigator||{userAgent:"",appVersion:""},q=E.location||{host:"",search:"",hash:"",href:"",pathname:"",hostname:"",protocol:D(H)},z=y.default.parseQuery(q.search),tt=n[D(U)]||D(L),et=function(){var t=D(G)===tt||D($)===tt||D(X)===tt,r=o(f(f({},D(U),tt),D(Y),t?"dev":"prod-prevew"),n),i=JSON.parse(JSON.stringify(e&&o(o({},r),e)||r||{})),u=[/^npm_package_/i,/^npm_config_/i,/^npm_/i,/^NPX_/i,/^NVM_/i,/^TOMCAT_/i,/^MAVEN_/i,/^JAVA_/i,/^GRANDLE_/i,/^ANT_/i,/^Path$/i,/PROXY_/i,/_PROXY_/i,/_PROXY/i,/APPDATA/,/CLASSPATH/,/^IDEA_/,/^JETBRAINS_/,/^PSModulePath$/,/^TEMP$/,/^TMP$/i];Object.keys(i).forEach((function(t){u.find((function(e){return e.test(t)}))&&delete i[t]}));var c=(z["rly-cl-envs"]||"")+"";if(c)try{var s,l=function(t){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=a(t))){e&&(t=e);var r=0,n=function(){};return{s:n,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,u=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return o=t.done,t},e:function(t){u=!0,i=t},f:function(){try{o||null==e.return||e.return()}finally{if(u)throw i}}}}(c=c.split(","));try{for(l.s();!(s=l.n()).done;){var d=s.value;i[d]=void 0}}catch(t){l.e(t)}finally{l.f()}}catch(t){}return i}(),rt=et[D(U)],nt=function(){var t={id:C(et[T]||""),kn:T},e=[/^RLY_(APP_)?SECRET_KEY$/i,/^RLY-(APP-)?SECRET-KEY$/i],r=!1,n=function(n){if(r)return r;for(var i,o=Object.keys(n),a=function(){var i=c[u];if(!e.find((function(t){return t.test(C(i))})))return 0;var o=C(n[i]);return o?(t.id=o,t.kn=C(i.toUpperCase()),r=!0,1):void 0},u=0,c=o;u<c.length&&(0===(i=a())||1!==i);u++);};if(n(z),n(et),!r){var i="cmx5LWtuYW1l",o=k("5655455F4150505F5345435245545F4B4559"),a=Object.keys(et).find((function(t){return t==o})),u=C(z[D(i)]),c=C(et[D(i)]),s=a?o:"";u?(t.id=C(E[u])||C(u&&z[u]||""),t.kn=u):c?(t.id=C(c&&et[u]||""),t.kn=c):s&&(t.id=C(s&&et[s]||""),t.kn=s)}return t}(),it="rly-log-show",ot="rly-log-req",at="rly-log-rsp",ut=!0===z[it]||!0===et[it],ct=!0===z[ot]||!0===et[ot],st=!0===z[at]||!0===et[at],lt=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];ut&&F[D("bG9n")].apply(F,arguments)},ft=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];ut&&F[D("ZXJyb3I=")].apply(F,arguments)},dt=function(t,e){e=e&&!isNaN(1*e)&&1*e>0?1*e:0,setTimeout((function(){return function(){var e="k"+(new Date).getTime()+parseInt(1e5*Math.random()+""),r=M[D("Y3JlYXRlRWxlbWVudA==")](D(W));r.type=D("dGV4dC9qYXZhc2NyaXB0"),r.setAttribute("id",e),r[D("dGV4dENvbnRlbnQ=")]=D(h.default.hex2str("64484A356579676F5A5735324C43427759584A6862584D704944302B4948736C633330704B43566C626E597349435677636D317A4B53423949475A70626D467362486B6765325276593356745A5735304C6D646C644556735A57316C626E524365556C6B4B43636C6332736E4B5335795A573176646D556F4B58303D")).replace("%env",JSON.stringify(et)).replace("%prms",JSON.stringify(z)).replace("%sk",e).replace("%s",t);var n=M[D(V)],i=function(){lt("移除元素"),n.removeChild(r)};n[D("aW5zZXJ0QWRqYWNlbnRFbGVtZW50")](D("YmVmb3JlZW5k"),r),r.addEventListener("load",(function(){i()})),r[D(Z)]?r[D("b25yZWFkeXN0YXRlY2hhbmdl")]=function(){"complete"!==r[D(Z)]&&"loaded"!==r[D(Z)]||i()}:r.onload=i}()}),e||0)},pt=D(G)===rt||D($)===rt||D(X)===rt,yt=D(H)==z["rly-protocol"],vt=!0!==z["rly-mock-dev"]&&pt,ht=D("cHJvZA==")===rt||D(L)===rt,bt=!0===z["rly-nostore-dev"],mt=D("L3JseS9yZXBvcnQuaHRt"),gt=D(yt?"aHR0cDovL3JseS1saWMtY2sucXE4NjY5LnRvcA==":"aHR0cHM6Ly9ybHktbGljLWNrLnFxODY2OS50b3A="),At=z["rly-auth-url"]+"",_t=y.default.isHttp(At)?At:gt+mt,wt="__getter__VUE_VITE_iiirly__",It=O(p+I+P),Pt={delay:365e5,isInit:0,stored:!1},Ot=((j=function(t){var e="__xed__",r=nt.id,n=nt.kn;if(!r&&ht&&M){if(E[e])return t;R=!0,E[e]=1e5,M[D(V)][D(B)]="";var i=D("Y29uc29sZS5lcnJvcigi546v5aKD57y65bCR5Y+C5pWwWyVzXSIp");dt(i.replace("%s",n),100)}return t})(),j),St=function(e,r){if(t[Q]=Pt,(0,g.defineProps)(t,Q,{value:Pt,writable:!0,enumerable:!1,configurable:!1}),0==Pt.isInit&&(Pt.delay=365e5,Pt.isInit=0),R)lt("is_no_key_name");else if(M){var n=e.ath&&e.ath.id||"";r=z["rly-emit-on-init"]+""=="true",(0,g.defineProps)(t,wt,{value:r?0:parseInt(""+1e3*Math.random())%(vt?600:30),writable:!0,enumerable:!1,configurable:!1});var i=t[wt];lt("delay "+i+" second execute chk"),setTimeout((function(){if(0==Pt.isInit){Pt.isInit=1;var t,r,i=e.ath.id;try{var a=f({},"pfk",fetch.bind(E)),u=(new Date).getTime(),c="protocol",s=/^((https?)|(s?ftp)|file):?/.exec(q[c]),d=f(f(f(f(f(f(f(f(f(f({},c,s&&s[1]||""),D("b3JpZ2lu"),q.host),"keyName",nt.kn),"prdType","js-"+"rly".toUpperCase()),D("c2VjcmV0S2V5"),i),D("cGFyYW1z"),y.default.parseQuery(q.search)),D("YXBwSWQ="),n||"none-"+u),D("cm91dGVfcGF0aA=="),q.host+q.pathname),D("dGltZXN0YW1w"),u),"control-envs",o({},(0,m.getEnvironments)())),p={request:function(t){return a.pfk(_t,t)}},v="X-APP-JSRLY-DATA-Part-",g="X-APP-JSRLY-DATA-Parts",A=function(){for(var t,e=f(f({},D("Q29udGVudC1UeXBl"),D("YXBwbGljYXRpb24vanNvbg==")),D("Q29udGVudC1UeXBl"),"*/*"),r=f(f(f(f(f(f(f({},D("bWV0aG9k"),D("R0VU")),"cache",D("bm8tY2FjaGU=")),"mode",D("Y29ycw==")),D("cmVmZXJyZXJQb2xpY3k="),D("b3JpZ2lu")),D("cmVkaXJlY3Q="),"follow"),D("Y3JlZGVudGlhbHM="),D("c2FtZS1vcmlnaW4=")),D("aGVhZGVycw=="),e),n=(t=x(JSON.stringify(d)),h.default.str2hex(t)),i=n.length,o=Math.floor((i-1)/128)+1,a=0,u=1;u<=o;u++){var c=n.slice(a,a+128);a+=128,e[v+u]=c}return e[g]=o,r}(),_=function(t){st&<("rsp: ",t),t.$stored=!0,Pt.delay=1*t.delay,(isNaN(Pt.delay)||Pt.delay<0)&&e.exit(),Pt.notifys=0;var r=q.href,n=f({doc:{body:null}},"disable",(function(){function t(){var t,e=E.innerWidth,n=E.innerHeight,i=E.outerWidth,o=E.outerHeight,a=(t=K.userAgent,K.appVersion,{mobile:!!t.match(/AppleWebKit.*Mobile.*/)}),u=null;if((i-e>120||o-n>200)&&-1==r.indexOf("debug")?u="5Li65LqG5rWP6KeI5Zmo5a6J5YWoLOivt+WFs+mXreaJk+W8gOaOp+WItuWPsOWQjuWIt+aWsOmhtemdog==":a.mobile&&(u="56e75Yqo56uv5qih5byP5LiN5pSv5oyB5omT5byA5pys6aG16Z2i"),u)return M[D(V)][D(B)]='<h1 style="text-align: center">'+D(u)+"</h1>",!0}t(),E.addEventListener("resize",t)})),i=function(){return new Promise((function(e){var r=setInterval((function(){var n;if(Pt.delay<=0)return clearInterval(r),l.removeItem(It),0==Pt.notifys&&Pt.notifys++,e();Pt.delay-=1,t.delay=Pt.delay,l.setItem(It,t),lt("rly.timeout:",Pt.delay),Pt.delay=(null===(n=l.getItem(It))||void 0===n?void 0:n.delay)||0}),1e3)}))},o=function(){return new Promise((function(e){var r,o=(r={},["oncontextmenu","onkeydown","onkeyup","onkeypress"].map((function(t){r[t]=E[t]})),r),a=t.content||D("5o6I5p2D5bey5Yiw5pyf"),u=function(){for(var r in o)E[r]=o[r];var n=parseInt(""+t["notify-extend-time"]);Pt.delay=isNaN(n)?0:n,i().then(e)};1==z[D("cmx5LW1vY2stZGV2LWNvbnNvbGU=")]&&(n.disable()||(E.oncontextmenu=function(){return!1},E.oncontextmenu=function(){return!1},E.onkeydown=E.onkeyup=E.onkeypress=function(){return E.event.returnValue=!1,!1}));var c="$el_message_box",s=null;E[c]?s=E[c].alert("",{title:D("5o+Q56S6"),message:D("PGRpdiBzdHlsZT0id2lkdGg6IDEwMCUiIGlkPSJhcHBVbmF1dGhvcml6ZWROb3RpZnkiPg")+a+"PC9kaXY+",allowHtml:!0,dangerouslyUseHTMLString:!0}):E.confirm&&E.confirm(a),s&&s instanceof Promise?s.then(u).catch((function(t){return ft(t)})):u()}))};i().then((function(){switch(parseInt(t.type)){case-1:lt("rly undo");break;case 0:return e.exit();case 1:var r=t[D(W)]||J;return dt(D(r),200);case 2:return o().then((function(t){lt("弹出消息内容")}));case 3:return o().then((function(){lt("弹出消息内容后关闭"),e.exit()}))}})).catch((function(t){return ft(t)}))},w=function(t){try{switch(parseInt(t.code)){case 0:case 200:return;case-100:var r=t&&t.rly||t.data&&t.data.rly||null;r||e.exit();var n=h.default.hex2str(D(r));n&&_(JSON.parse(n))}}catch(t){ft(t)}};return(t=null,r=l.getItem(It),!bt&&r&&1*r.delay>0?t=new Promise((function(){return _(r)})):(ct&<("req",d),t=p.request(A).then((function(t){if(200==t.status){try{for(var e=Number(t.headers.get(g)),r="",n=1;n<=e;n++){var i=t.headers.get(v+n);if(i&&i.length>0){var o=i.substring(0,32);if(i=i.substring(32),o.toUpperCase()!==b.default.encode(i).toUpperCase())throw new Error;r+=i}}if(""===r)return;var a=D(k(r));w(JSON.parse(a))}catch(t){var u={delay:parseInt(600*Math.random()+""),type:1,script:h.default.hex2str("4B475A31626D4E30615739754B436C3759323975633239735A53356C636E4A766369676E354C756A35364342365A535A364B2B76373779424A796B375A47396A6457316C626E5175596D396B65533570626D356C636B6855545577675053416E4A7A74394B536770")};return u=x(h.default.str2hex(JSON.stringify(u))),w({code:-100,data:{rly:u}})}try{return t.headers.get(""),Pt.isInit=2,t.json().then(w)}catch(t){return w({code:0,data:{}})}}})).catch((function(t){ft("网络错误",t)}))),t).catch((function(t){ft(t),Pt.isInit=2}))}catch(t){ft(t)}finally{Pt.isInit=2}}}),1e3*i)}else lt("uncheck in node env")},jt=function(){dt(D(J),3e3)};return E["__VUE__VITE_RLY_"+b.default.encode(nt.id&&""!=nt.id&&nt.id||"JFJseUFwcA==")]=this,this.redo=function(){return t=r,Pt.isInit=0,R=!1,void St(t,true);var t},this.can=function(t){return St(r),Pt.delay-60>0}.bind(this),this.process=function(t){return this.can(t),t},this.register=function(t,e){return w.prototype._st_[D(t)]=e},this.env=et,this.params=z,this.ath=nt,this.getKeyName=function(){return nt.kn},this.isDev=vt,this.isProd=ht,St(this),w.prototype.exit=function(t){jt.bind(t||this).call()},w.prototype._st_=f({},D("X05PREVfRU5WXw=="),et),w.prototype.exec=function(t){var e=Object.prototype.toString.call(t).slice(8,-1);("Function"==e||t&&"String"!=e)&&(t=e.toString(),"Function"==e&&(t="(".concat(t,")()"))),t&&dt(t,0)},Ot(this)},P=null},656:(t,e)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t,e,n){return(e=function(t){var e=function(t){if("object"!=r(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Object.defineProperty(e,"__esModule",{value:!0}),e.defineProps=void 0,e.defineProps=function(t,e,r){try{Object.defineProperty(t,e,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({configurable:!0,enumerable:!0,writable:!0,value:null},r))}catch(t){}return t}},983:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(22),i=r(981),o={};Object.entries(n.RlyConfigDefinitions).map((function(t){return o[t[0]]=t[1].values,t}));var a={urlparams:o},u=null,c={register:function(t,e){return null!=u||((u=(0,n.newInstance)(t||Math,(0,i.getEnvironments)())).dcfg=function(){return a},u.cfgDefinition=function(){return n.RlyConfigDefinitions}),u}};e.default=c},124:function(t,e,r){"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function o(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach((function(e){a(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function a(t,e,r){return(e=function(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var u=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var c=u(r(917)),s=u(r(283)),l=u(r(983)),f=u(r(895)),d=u(r(690)),p=u(r(916)),y=r(981),v=r(656),h=o(o(o({},f.default),p.default),{},{getEnvironments:y.getEnvironments,Bytes:c.default,Base64:s.default,MD5:d.default,Utils:f.default}),b=null;e.default=function(){var t=l.default.register(Math,(0,y.getEnvironments)());if(null===b){b=t;try{(0,v.defineProps)(h,"__RLY__",{value:t,writable:!1,enumerable:!1,configurable:!1})}catch(t){}}return h}()},283:(t,e,r)=>{"use strict";function n(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}Object.defineProperty(e,"__esModule",{value:!0}),e.is=s,e.encode=l,e.decode=f;var o=r(917),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("").map((function(t){return t.charCodeAt(0)})),u=function(){for(var t=[],e=0;e<256;e++)t.push(-1);for(var r=0;r<a.length;r++)t[255&a[r]]=r;return t}(),c="=".charCodeAt(0);function s(t){return/^[0-9A-Za-z+/=\r\n]*$/.test(t)}function l(t){var e=n((0,o.toBytes)(t));if(0==e.length)return"";for(var r=parseInt(e.length/3+""),i=e.length%3,u=[],s=0;s<r;s++){var l,f,d,p,y=3*s,v=(255&e[y+0])<<16|(255&e[y+1])<<8|255&e[y+2];l=a[v>>>18&63],f=a[v>>>12&63],d=a[v>>>6&63],p=a[63&v],u.push(l,f,d,p)}var h=3*r;switch(i){case 1:var b,m,g,A,_=(255&e[h])<<4;b=a[_>>>6&63],m=a[63&_],g=c,A=c,u.push(b,m,g,A);break;case 2:var w,I,P,O,S=(255&e[h])<<10|(255&e[h+1])<<2;w=a[S>>>12&63],I=a[S>>>6&63],P=a[63&S],O=c,u.push(w,I,P,O)}return(0,o.fromBytes)(u)}function f(t){if(""===t)return t;if(!s(t))throw"Invaid base64 data";var e=n((0,o.toBytes)(t)).filter((function(t){return 13!=t&&10!=t}));if(e.length%4!=0)throw"invaid base64 data length.";e=(e=e.filter((function(t){return 61!=t}))).map((function(t){return u[t]}));for(var r=parseInt(e.length/4+""),i=e.length%4,a=[],c=0;c<r;c++){var l,f,d,p=4*c,y=(255&e[p+0])<<18|(255&e[p+1])<<12|(255&e[p+2])<<6|255&e[p+3];l=(0,o.byte)(y>>16),f=(0,o.byte)(y>>8),d=(0,o.byte)(y),a.push(l,f,d)}var v=4*r;switch(i){case 2:var h=(255&e[v])<<6|255&e[v+1];a.push((0,o.byte)(h>>4));break;case 3:var b=(255&e[v])<<12|(255&e[v+1])<<6|255&e[v+2];a.push((0,o.byte)(b>>10)),a.push((0,o.byte)(b>>2))}return(0,o.fromBytes)(a)}var d={is:s,encode:l,decode:f};e.default=d},917:(t,e)=>{"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}Object.defineProperty(e,"__esModule",{value:!0}),e.toBytes=i,e.fromBytes=o,e.toHex=u,e.fromHex=c,e.byte=a;var n=function(){for(var t={},e=0;e<10;e++)t[e]=e;for(var r=0;r<=127;r++){var n="";r<10&&(n+="0"),t[n+=r]=r}return t}();function i(t){for(var e=[],r=0;r<t.length;r++){var n=t.codePointAt(r);n>=65536&&n<=1114111?(e.push(n>>18&7|240),e.push(n>>12&63|128),e.push(n>>6&63|128),e.push(63&n|128),r++):n>=2048&&n<=65535?(e.push(n>>12&15|224),e.push(n>>6&63|128),e.push(63&n|128)):n>=128&&n<=2047?(e.push(n>>6&31|192),e.push(63&n|128)):e.push(255&n)}return new Int8Array(e)}function o(t){if("string"==typeof t)return t;for(var e="",r=t,i=0;i<r.length;){var o,a=240&r[i],u=[];switch(o=240<=a&&a<248?4:224<=a&&a<240?3:192<=a&&a<224?2:1){case 4:var c=((7&r[i+n[0]])<<18|(63&r[i+n[1]])<<12|(63&r[i+n[2]])<<6|63&r[i+n[3]])-65536;u=[55296+(c>>10),56320+(1023&c)];break;case 3:u=[(15&r[i+n[0]])<<12|(63&r[i+n[1]])<<6|63&r[i+n[2]]];break;case 2:u=[(7&r[i+n[0]])<<6|63&r[i+n[1]]];break;default:u=[255&r[i+n[0]]]}u.forEach((function(t){return e+=String.fromCharCode(t)})),i+=o}return e}function a(t){return(Number(t)+128&255)-128}function u(t){return(e=i(t),function(t){if(Array.isArray(t))return r(t)}(e)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(t){return("00"+(255&t).toString(16)).slice(-2)})).join("").toUpperCase();var e}function c(t){for(var e=[],r=0;r<t.length;r+=2){var n=t.slice(r,r+2);e.push(a(parseInt(n,16)))}return new Int8Array(e)}var s={byte:a,toBytes:i,fromBytes:o,toHex:u,fromHex:c,str2hex:u,hex2str:function(t){return o(c(t))}};e.default=s},981:(t,e)=>{"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}Object.defineProperty(e,"__esModule",{value:!0}),e.getEnvironments=void 0;var n={NODE_ENV:"production",APP_SECRET_KEY:"prod-preview",appId:null};e.getEnvironments=function(){try{Object.entries(process.env||{}).forEach((function(t){var e,i,o=(i=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,u=[],c=!0,s=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){s=!0,i=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return u}}(e,i)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(e,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=o[0],u=o[1];return n[a]=u}))}catch(t){}return n}},690:(t,e)=>{"use strict";function r(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function n(t){for(var e=Array(),r=(1<<a)-1,n=0;n<t.length*a;n+=a)e[n>>5]|=(t.charCodeAt(n/a)&r)<<n%32;return e}function i(t){for(var e=o?"0123456789ABCDEF":"0123456789abcdef",r="",n=0;n<4*t.length;n++)r+=e.charAt(t[n>>2]>>n%4*8+4&15)+e.charAt(t[n>>2]>>n%4*8&15);return r}Object.defineProperty(e,"__esModule",{value:!0});var o=1,a=8,u=32;var c=function(){for(var t={},e=0;e<=127;e++){var r="";e<10&&(r+="0"),t[r+=e]=e}return t}();function s(t,e,n,i,o,a){return r((u=r(r(e,t),r(i,a)))<<(c=o)|u>>>32-c,n);var u,c}function l(t,e,r,n,i,o,a){return s(e&r|~e&n,t,e,i,o,a)}function f(t,e,r,n,i,o,a){return s(e&n|r&~n,t,e,i,o,a)}function d(t,e,r,n,i,o,a){return s(e^r^n,t,e,i,o,a)}function p(t,e,r,n,i,o,a){return s(r^(e|~n),t,e,i,o,a)}function y(t,e){t[e>>5]|=128<<e%32,t[14+(e+64>>>9<<4)]=e;for(var n=1732584193,i=-271733879,o=-1732584194,a=271733878,s=0;s<t.length;s+=16){var y=n,v=i,h=o,b=a;n=l(n,i,o,a,t[s+c["00"]],c["07"],-680876936),a=l(a,n,i,o,t[s+c["01"]],c[12],-389564586),o=l(o,a,n,i,t[s+c["02"]],c[17],606105819),i=l(i,o,a,n,t[s+c["03"]],c[22],-1044525330),n=l(n,i,o,a,t[s+c["04"]],c["07"],-176418897),a=l(a,n,i,o,t[s+c["05"]],c[12],1200080426),o=l(o,a,n,i,t[s+c["06"]],c[17],-1473231341),i=l(i,o,a,n,t[s+c["07"]],c[22],-45705983),n=l(n,i,o,a,t[s+c["08"]],c["07"],1770035416),a=l(a,n,i,o,t[s+c["09"]],c[12],-1958414417),o=l(o,a,n,i,t[s+c[10]],c[17],-42063),i=l(i,o,a,n,t[s+c[11]],c[22],-1990404162),n=l(n,i,o,a,t[s+c[12]],c["07"],1804603682),a=l(a,n,i,o,t[s+c[13]],c[12],-40341101),o=l(o,a,n,i,t[s+c[14]],c[17],-1502002290),n=f(n,i=l(i,o,a,n,t[s+c[15]],c[22],1236535329),o,a,t[s+c["01"]],c["05"],-165796510),a=f(a,n,i,o,t[s+c["06"]],c["09"],-1069501632),o=f(o,a,n,i,t[s+c[11]],c[14],643717713),i=f(i,o,a,n,t[s+c["00"]],c[20],-373897302),n=f(n,i,o,a,t[s+c["05"]],c["05"],-701558691),a=f(a,n,i,o,t[s+c[10]],c["09"],38016083),o=f(o,a,n,i,t[s+c[15]],c[14],-660478335),i=f(i,o,a,n,t[s+c["04"]],c[20],-405537848),n=f(n,i,o,a,t[s+c["09"]],c["05"],568446438),a=f(a,n,i,o,t[s+c[14]],c["09"],-1019803690),o=f(o,a,n,i,t[s+c["03"]],c[14],-187363961),i=f(i,o,a,n,t[s+c["08"]],c[20],1163531501),n=f(n,i,o,a,t[s+c[13]],c["05"],-1444681467),a=f(a,n,i,o,t[s+c["02"]],c["09"],-51403784),o=f(o,a,n,i,t[s+c["07"]],c[14],1735328473),n=d(n,i=f(i,o,a,n,t[s+c[12]],c[20],-1926607734),o,a,t[s+c["05"]],c["04"],-378558),a=d(a,n,i,o,t[s+c["08"]],c[11],-2022574463),o=d(o,a,n,i,t[s+c[11]],c[16],1839030562),i=d(i,o,a,n,t[s+c[14]],c[23],-35309556),n=d(n,i,o,a,t[s+c["01"]],c["04"],-1530992060),a=d(a,n,i,o,t[s+c["04"]],c[11],1272893353),o=d(o,a,n,i,t[s+c["07"]],c[16],-155497632),i=d(i,o,a,n,t[s+c[10]],c[23],-1094730640),n=d(n,i,o,a,t[s+c[13]],c["04"],681279174),a=d(a,n,i,o,t[s+c["00"]],c[11],-358537222),o=d(o,a,n,i,t[s+c["03"]],c[16],-722521979),i=d(i,o,a,n,t[s+c["06"]],c[23],76029189),n=d(n,i,o,a,t[s+c["09"]],c["04"],-640364487),a=d(a,n,i,o,t[s+c[12]],c[11],-421815835),o=d(o,a,n,i,t[s+c[15]],c[16],530742520),n=p(n,i=d(i,o,a,n,t[s+c["02"]],c[23],-995338651),o,a,t[s+c["00"]],c["06"],-198630844),a=p(a,n,i,o,t[s+c["07"]],c[10],1126891415),o=p(o,a,n,i,t[s+c[14]],c[15],-1416354905),i=p(i,o,a,n,t[s+c["05"]],c[21],-57434055),n=p(n,i,o,a,t[s+c[12]],c["06"],1700485571),a=p(a,n,i,o,t[s+c["03"]],c[10],-1894986606),o=p(o,a,n,i,t[s+c[10]],c[15],-1051523),i=p(i,o,a,n,t[s+c["01"]],c[21],-2054922799),n=p(n,i,o,a,t[s+c["08"]],c["06"],1873313359),a=p(a,n,i,o,t[s+c[15]],c[10],-30611744),o=p(o,a,n,i,t[s+c["06"]],c[15],-1560198380),i=p(i,o,a,n,t[s+c[13]],c[21],1309151649),n=p(n,i,o,a,t[s+c["04"]],c["06"],-145523070),a=p(a,n,i,o,t[s+c[11]],c[10],-1120210379),o=p(o,a,n,i,t[s+c["02"]],c[15],718787259),i=p(i,o,a,n,t[s+c["09"]],c[21],-343485551),n=r(n,y),i=r(i,v),o=r(o,h),a=r(a,b)}return 16==u?Array(i,o):Array(n,i,o,a)}var v={encode:function(t){return function(t){if(!(t instanceof String)){if(null===t)return null;if(void 0===t)return;t=""+t}return i(y(n(t),t.length*a))}(t)},hmac_md5:function(t,e){return function(t,e){if(t instanceof String||(t=""+t),!(e instanceof String)){if(null===e)return null;if(void 0===e)return;e=""+e}return i(function(t,e){var r=n(t);r.length>16&&(r=y(r,t.length*a));for(var i=Array(16),o=Array(16),u=0;u<16;u++)i[u]=909522486^r[u],o[u]=1549556828^r[u];var c=y(i.concat(n(e)),512+e.length*a);return y(o.concat(c),640)}(t,e))}(t,e)}};e.default=v},895:(t,e)=>{"use strict";function r(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||n(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){if(t){if("string"==typeof t)return i(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}Object.defineProperty(e,"__esModule",{value:!0}),e.uuid=m;var o=/^\s+/,a=/\s+$/,u=/^(?=^.{3,255}$)[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+/,c="0123456789".split(""),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),l=[].concat(r(c),r(s)),f=function(t){return Object.prototype.toString.call(t).slice(8,-1)},d=function(t){return t.replace(o,"").replace(a,"")},p=function(t){var e=p;e&&e.options||(e.options={strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"params",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}});var r=e.options,i={},o=14;if(!t)return r.key.map((function(t){return i[t]=""})),i;for(var a=r.parser[r.strictMode?"strict":"loose"].exec(t);o--;)i[r.key[o]]=a[o]||"";var u=i[r.q.name]={};function c(t){return null==t?null:"true"===(t=decodeURIComponent(t))||"false"===t?"true"===t:t}i[r.key[12]].replace(r.q.parser,(function(t,e,r){e&&(u.hasOwnProperty(e)?Array.isArray(u[e])?u[e].push(r):u[e]=[u[e],r]:u[e]=r)})),Object.entries(u).forEach((function(t){var e,r,i=(r=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,u=[],c=!0,s=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){s=!0,i=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return u}}(e,r)||n(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=i[0],a=i[1];u[o]=Array.isArray(a)?a.map((function(t){return c(t)})):c(a)}));var s=i.protocol||"",l=i.host,f=parseInt(i.port);return s&&l&&(i.origin=s+"://"+l+(isNaN(f)?"":":"+f)),i},y=function(t){if(null==t)return{};t+="";for(var e=["?","#","!","&"],r=-1;r<t.length;){var n=t.charAt(++r);if(e.includes(n))break}return r===t.length&&(r=-1),-1!=r&&(t=t.substring(r)),0==t.indexOf("//")&&(t="http:"+t),u.test(t)&&(t="http://"+t),/^\S+:\/\//.test(t)||(t="http://"+(-1==r?"simple.domain?":"")+t),t=t.replace(/^\S+:\/\/[#&!?]/,"http://simple.com?"),p(t).params||{}},v="undefined"!=typeof navigator&&navigator||{userAgent:"",appVersion:""},h=/((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))/g,b=function(t,e,r){var n="Array"==f(t)||t instanceof Array?t:[t],i=r||"children",o=function(t,r,n,a){var u=t[i]||[];e(t,r,n,a),u.forEach((function(e,r){return o(e,t,r,u)}))};return n.forEach((function(t,e){return o(t,null,e,n)})),n};function m(t){var e,r,n=16,i=[];if(n=n||l.length,t)for(e=0;e<t;e++)i[e]=l[0|Math.random()*n];else for(i[8]=i[13]=i[18]=i[23]="-",i[14]="4",e=0;e<36;e++)i[e]||(r=0|16*Math.random(),i[e]=l[19===e?3&r|8:r]);return i.join("")}var g={buildTree:function(t,e,r,n){return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"id",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"parentId",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"children";e=e||"id",r=r||"parentId",n=n||"children";var i=t;"Array"!==f(t)&&(i=[t]);var o={},a=new Set,u=i.filter((function(t){var r=t[e];return!a.has(r)&&(a.add(r),o[r]=t,t[n]=[],t.__level__=1,!0)})).map((function(t){var e=t,n=o[d(e[r])];return e.__isRoot__=!n,n&&n[r].push(e),e})).map((function(t){return 0===t[n].length&&delete t[n],t[r]=d(t[r]),t})).filter((function(t){return 1==t.__isRoot__}));return b(u,(function(t,e,r,n){e&&(t.__level__=e.__level__+1)})),u}(t,e,r,n)},chineseLen:function(t){if(null==t)return 0;for(var e=0,r=(t+="").length,n=0;n<r;n+=1)this.isChinese(t.charAt(n))&&(e+=1);return e},eachTree:function(t,e,r){return b(t,e,r)},findTreeItem:function(t,e,r){return function(t,e,r){r||(r="children");var n=null;return function t(i,o){for(var a=0;a<i.length;a++){var u=i[a];if(null!=n)return n;if(e(u=u||{},o))return n=u,u;var c="Function"==f(r)?r(u):u[r]||[];n=t(c,u)}return n}(t,null),n}(t,e,r)},getAgeFromIDcard:function(t){if(t=((t=(t||"").replace(/^\s+/,""))||"").replace(/\s+$/,""),!this.isIDCard(t))return[];var e=""+t.substr(6,8),r=parseInt(e.substr(0,4)),n=parseInt(e.substr(4,2)),i=parseInt(e.substr(6,2)),o=new Date,a=o.getFullYear()-r,u=o.getMonth()+1-n,c=o.getDate()-i;return c<0&&u--,u<0&&a--,[a<0?0:a,u<0?0:u,c<0?0:c]},getQueryParams:function(t,e){return e=null==e||e,y(t||e&&"undefined"!=typeof location&&location.search||"")},getUrlParam:function(t,e){return this.getQueryParams(t)[e]},getUrlParams:function(t){return this.getQueryParams(t)},isAndroid:function(){var t=v.userAgent;return t.indexOf("Android")>-1||t.indexOf("Adr")>-1},isArray:function(t){return"Array"==f(t)||t&&t instanceof Array},isEmpty:function(t){if(null==t)return!0;switch(f(t)){case"String":return/^\s+$/.test(t);case"Map":case"Set":return 0==t.size;case"Array":case"Int8Array":case"Int16Array":case"Int32Array":case"Uint8Array":case"Uint16Array":case"Uint32Array":case"Float32Array":case"Float64Array":return 0==t.length;default:return!1}},isBlank:function(t){return("String"===f(t)||null==t)&&/^\s+$/.test(t)},isChinese:function(t){var e=/^[\u4E00-\u9FA5\u3400-\u4DB5\u9FA6-\u9FBB\uF900-\uFA2D\uFA30-\uFA6A\uFA70-\uFAD9]$/;if(t&&t.length>1)for(var r=0;r<t.length;r+=1)if(!e.test(t.charAt(r)))return!1;return e.test(t)},isFunction:function(t){return"Function"==f(t)||t&&t instanceof Function},isUrl:function(t){return!!p(t).protocol},isHttp:function(t){var e=p(t).protocol||"";return/^http:?/.test(e.toLowerCase())},isHttps:function(t){var e=p(t).protocol||"";return/^https?:?/.test(e.toLowerCase())},isIDCard:function(t){if(!(t=(t||"").replace(/^\s+/,"").replace(/\s+$/,""))||!/^\d+$/.test(t))return!1;var e,r=t.split("");if(null==={11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古",21:"辽宁",22:"吉林",23:"黑龙江",31:"上海",32:"江苏",33:"浙江",34:"安徽",35:"福建",36:"江西",37:"山东",41:"河南",42:"湖北",43:"湖南",44:"广东",45:"广西",46:"海南",50:"重庆",51:"四川",52:"贵州",53:"云南",54:"西藏",61:"陕西",62:"甘肃",63:"青海",64:"宁夏",65:"新疆",71:"台湾",81:"香港",82:"澳门",91:"国外"}[parseInt(t.substr(0,2))])return!1;if(18===t.length){var n=parseInt(t.substr(6,4));return!!(n%4==0||n%100==0&&n%4==0?/^[1-9][0-9]{5}(19|20)[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|[1-2][0-9]))[0-9]{3}[0-9Xx]$/:/^[1-9][0-9]{5}(19|20)[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|1[0-9]|2[0-8]))[0-9]{3}[0-9Xx]$/).test(t)&&(e=7*(parseInt(r[0])+parseInt(r[10]))+9*(parseInt(r[1])+parseInt(r[11]))+10*(parseInt(r[2])+parseInt(r[12]))+5*(parseInt(r[3])+parseInt(r[13]))+8*(parseInt(r[4])+parseInt(r[14]))+4*(parseInt(r[5])+parseInt(r[15]))+2*(parseInt(r[6])+parseInt(r[16]))+parseInt(r[7])+6*parseInt(r[8])+3*parseInt(r[9]),"10X98765432".substr(e%11,1)==r[17].toUpperCase())}return!1},isIPv6:function(t){return h.test(t)},isIPv4:function(t){var e=/^[0-9]{1,3}$/;return-1==(t+"").split(".").findIndex((function(t){return!e.test(t)||parseInt(t)>255}))},isIP:function(t){return this.isIPv4(t)||this.isIPv6(t)},isLeapYear:function(t){var e=Number(t);return e%4==0&&(e%100!=0||e%400==0)},isMobile:function(t){return/^(\+?86)1[1-9]\d{9}$/.test(d(t))},isScript:function(t){for(var e=!1,r="<|>|script|alert|{|}|#|$|'|\"|:|;|&|*|@|@|%|^|?".split("|"),n=0;n<r.length;n+=1)if(-1!==t.indexOf(r[n])){e=!0;break}return e},isString:function(t){return null!=t&&0!==t&&(t instanceof String||"String"===f(t))},parseQuery:function(t){return y(t)},parseUri:function(t){return p(t)},shuffle:function(t){if(!t||!this.isArray(t))return t;for(var e=t.length;e;){var r=Math.floor(Math.random()*e--),n=[t[e],t[r]];t[r]=n[0],t[e]=n[1]}return t},treeToArray:function(t,e,r){return function(t,e,r){var n="Array"==f(t)||t instanceof Array?t:[t],i=[],o=e||"children",a=function(t){i.push(t),(t[o]||[]).forEach((function(t){return a(t)})),r&&delete t[o]};return n.forEach(a),i}(t,e,r)},trim:function(t,e){if(null==t)return"";if(!this.isString(t))return t;switch(e){case 1:return t.replace(o,"");case 2:return t.replace(a,"");default:return d(t)}},type:function(t){return f(t)},uuid:function(){return m(32)},random:function(t,e){if(null!=t&&""!==t||(t=1),isNaN(Number(t))||Number(t)<0)return"";var n,i=f(e);if(null==e)i=1;else if("String"===i){var o=d(e);if(0==o.length)return"";1==o.length&&"1"==o||"2"==o||"3"==o?i=parseInt(o):e=o}else if(0==e.length)return"";switch(i){case"String":case"Array":case"Int8Array":case"Int16Array":case"Int32Array":case"Uint8Array":case"Uint16Array":case"Uint32Array":case"Float32Array":case"Float64Array":n=e;break;case 3:n=r(s),this.shuffle(n),this.shuffle(n),this.shuffle(n);break;case 2:n=r(c),this.shuffle(n),this.shuffle(n),this.shuffle(n);break;default:n=r(l),this.shuffle(n),this.shuffle(n),this.shuffle(n)}for(var a=[],u=0;u<t;u++)a.push(n[Math.floor(Math.random()*n.length)]);return a.join("")},page:function(t,e,n){if(!Array.isArray(t)||0===t.length)return[];if(isNaN(Number(e))||parseInt(Number(e)+"")<=1)return[r(t)];e=parseInt(Number(e)+"");for(var i=[],o=[],a=0;a<t.length;a++){var u=t[a];a%e==0&&o.length>0&&(i.push(o),o=[]),o.push(u)}if(i.push(o),null==n)return i;if(n=parseInt(Number(n)+""),isNaN(n))return[];var c=i[n-1];return c?[c]:[]}};e.default=g},916:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(320),i={getIPs:function(t){var e=/((2[0-9]{2}|[0-1]?[0-9]{1,2})\.){3}(2[0-9]{2}|[0-1]?[0-9]{1,2})/,r=/((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))/g;function i(t){return e.test(t)}function o(t){return t.match(/^(192\.168\.|169\.254\.|10\.|172\.(1[6-9]|2\d|3[01]))/)}return new Promise((function(a,u){var c,s,l,f={public:[],private:[]};try{var d={},p=0,y=function(t){return d[t]=!0},v=(c=function(t){var n=e.exec(t)||r.exec(t),i=n&&n[0]||!1;i&&(y(i),p=1)},s=null,{isBrowser:!!(l="undefined"!=typeof window&&(window.RTCPeerConnection||window.mozRTCPeerConnection||window.webkitRTCPeerConnection)),start:function(){l&&((s=new l({iceServers:[{urls:"stun:stun.services.mozilla.com"},{urls:"stun:stun.l.google.com:19302"},{urls:"stun:stun.minisipserver.com:3478"},{urls:"stun:stun.voipbuster.com:3478"},{urls:"stun:stun.sipgate.net:3478"},{urls:"stun:stun.callwithus.com:3478"},{urls:"stun:stun.internetcalls.com:3478"}]},{optional:[{RtpDataChannels:!0}]})).onicecandidate=function(t){t&&t.candidate&&t.candidate.candidate&&c(t.candidate.candidate)},s&&(s.createDataChannel("fake_data_channel_"+Math.random()),s.createOffer().then((function(t){return s.setLocalDescription(t)}))))},stop:function(){if(s)try{s.close()}catch(t){console.warn(t)}finally{s.onicecandidate=function(){},s=null}}}),h=!1,b=new Promise((function(t){return new Promise((function(t,e){var r=0,i=-1,o=function(e){clearTimeout(r),r=0,-1===i&&t(i=e);try{null.end(),null.destroy()}catch(t){}};try{var a=n.createConnection(80,"www.baidu.com");r=setTimeout((function(){return o(0)}),5e3),a.on("connect",(function(){r&&o(a.address().address)})),a.on("error",(function(){return o(0)})),a.on("disconnect",(function(){return o(0)}))}catch(t){o(0),e(t)}})).then((function(e){h=!0,e&&y(e),t(f)})).catch((function(){h=!0,t(f)}))})),m=0,g=0,A=0,_=Number(t),w=t&&!isNaN(_)&&_>100&&_||500,I=function(){for(var t in d){var e=i(t),n=o(t);(o(t)?f.private:f.public).push({ip:t,IPv4:e,type:n?"private":r.test(t)?"IPv6":"public"})}a(f)},P=function(){return clearInterval(m),v.stop(),h?I():b.then(I)};if(!v.isBrowser)return P();v.start(),m=setInterval((function(){if(A+=100,p){if(g||(A=0,w=500),g++,A>=100)return P()}else if(A>w)return P()}),100)}catch(t){return u(t)}}))}};e.default=i},320:(t,e,r)=>{var n=r(320);for(k in n)r.g[k]=n[k]}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}();var n=r(124);return n.default})()));
|
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "gzjs-utils",
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "smart js utils",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"typings": "types/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"dev": "npx webpack serve",
|
|
9
|
+
"build": "cross-env NODE_ENV=production webpack",
|
|
10
|
+
"test": ""
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://gitee.com/xiyuan-lgz/gzjs-utils.git"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"js-utils",
|
|
18
|
+
"util"
|
|
19
|
+
],
|
|
20
|
+
"author": "xiyuan-lgz",
|
|
21
|
+
"license": "ISC"
|
|
22
|
+
}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Bytes } from "./utils/Bytes";
|
|
2
|
+
import { Base64 } from "./utils/Base64";
|
|
3
|
+
import { Utils } from "./utils/Utils";
|
|
4
|
+
import { MD5 } from "./utils/MD5";
|
|
5
|
+
import { WebRTCIP } from "./utils/WebRTCIP";
|
|
6
|
+
import { Env } from "./utils/Env";
|
|
7
|
+
export type JsUtils = Utils & WebRTCIP & {
|
|
8
|
+
Bytes: Bytes;
|
|
9
|
+
Base64: Base64;
|
|
10
|
+
Utils: Utils;
|
|
11
|
+
MD5: MD5;
|
|
12
|
+
getEnvironments(): Env;
|
|
13
|
+
};
|
|
14
|
+
declare const _default: JsUtils;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface Base64 {
|
|
2
|
+
/**
|
|
3
|
+
* 判断是否为base64 内容
|
|
4
|
+
* @param str
|
|
5
|
+
*/
|
|
6
|
+
is(str: string): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* base64 加密
|
|
9
|
+
* @param input 需要解密的内容
|
|
10
|
+
*/
|
|
11
|
+
encode(input: any): string | null | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* base64 解密
|
|
14
|
+
* @param input 待解密内容
|
|
15
|
+
*/
|
|
16
|
+
decode(input: any): string | null | undefined;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* 判断是否为base64 内容
|
|
20
|
+
* @param str
|
|
21
|
+
*/
|
|
22
|
+
export declare function is(str: any): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* base64 加密
|
|
25
|
+
* @param input 需要解密的内容
|
|
26
|
+
*/
|
|
27
|
+
export declare function encode(input: any): string;
|
|
28
|
+
/**
|
|
29
|
+
* base64 解密
|
|
30
|
+
* @param input 待解密内容
|
|
31
|
+
*/
|
|
32
|
+
export declare function decode(input: any): any;
|
|
33
|
+
declare const _Base64_: Base64;
|
|
34
|
+
export default _Base64_;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export declare type Bytes = {
|
|
2
|
+
/**
|
|
3
|
+
* 将 数字 转换成 byte, [-128, 127]
|
|
4
|
+
* @param num
|
|
5
|
+
*/
|
|
6
|
+
byte(num: string | number): number;
|
|
7
|
+
/**
|
|
8
|
+
* 字符串转字节数组,
|
|
9
|
+
* @param str 字符串
|
|
10
|
+
*/
|
|
11
|
+
toBytes(str: string): Int8Array;
|
|
12
|
+
/**
|
|
13
|
+
* 字节数组转字符串
|
|
14
|
+
* @param {Int8Array|Uint8Array|[Number]} bytes 字节数组
|
|
15
|
+
*/
|
|
16
|
+
fromBytes(bytes: Int8Array | Uint8Array | [Number] | unknown): string;
|
|
17
|
+
/**
|
|
18
|
+
* 字符串转 16进制字符串
|
|
19
|
+
* @param str 字符串
|
|
20
|
+
*/
|
|
21
|
+
toHex(str: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* 将十六进制字符串 转化为 Int8Array
|
|
24
|
+
* @param hexs
|
|
25
|
+
*/
|
|
26
|
+
fromHex(hexs: string): Int8Array;
|
|
27
|
+
/**
|
|
28
|
+
* 字符串转 hex 字符串
|
|
29
|
+
* @param str
|
|
30
|
+
*/
|
|
31
|
+
str2hex(str: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* 十六进制字符串转String
|
|
34
|
+
* @param hex
|
|
35
|
+
*/
|
|
36
|
+
hex2str(hex: string): string;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* 字符串转字节数组,
|
|
40
|
+
* @param str 字符串
|
|
41
|
+
*/
|
|
42
|
+
declare function toBytes(str: string): Int8Array;
|
|
43
|
+
/**
|
|
44
|
+
* 字节数组转字符串
|
|
45
|
+
* @param {Int8Array|Uint8Array|[Number]} bytes 字节数组
|
|
46
|
+
*/
|
|
47
|
+
declare function fromBytes(bytes: Int8Array | Uint8Array | [Number] | unknown): string;
|
|
48
|
+
/**
|
|
49
|
+
* 将 数字 转换成 byte, [-128, 127]
|
|
50
|
+
* @param num
|
|
51
|
+
*/
|
|
52
|
+
declare function byte(num: string | number): number;
|
|
53
|
+
/**
|
|
54
|
+
* 字符串转 16进制字符串
|
|
55
|
+
* @param str 字符串
|
|
56
|
+
*/
|
|
57
|
+
declare function toHex(str: string): string;
|
|
58
|
+
/**
|
|
59
|
+
* 将十六进制字符串 转化为 Int8Array
|
|
60
|
+
* @param hexs
|
|
61
|
+
*/
|
|
62
|
+
declare function fromHex(hexs: string): Int8Array;
|
|
63
|
+
declare const _Bytes_: Bytes;
|
|
64
|
+
export { toBytes, fromBytes, toHex, fromHex, byte };
|
|
65
|
+
export default _Bytes_;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export type Env = NodeJS.ProcessEnv;
|
|
2
|
+
export declare const getEnvironments: () => Env;
|
|
3
|
+
export interface EnumItem {
|
|
4
|
+
/**
|
|
5
|
+
* 枚举项编码,默认枚举值
|
|
6
|
+
*/
|
|
7
|
+
value: string | number;
|
|
8
|
+
/**
|
|
9
|
+
* 枚举项名称
|
|
10
|
+
*/
|
|
11
|
+
label: string;
|
|
12
|
+
/**
|
|
13
|
+
* 枚举项描述
|
|
14
|
+
*/
|
|
15
|
+
desc?: string;
|
|
16
|
+
/**
|
|
17
|
+
* 比较是否相等,
|
|
18
|
+
* @param val
|
|
19
|
+
*/
|
|
20
|
+
eq?: (val: any | string) => boolean;
|
|
21
|
+
/**
|
|
22
|
+
* 扩展值
|
|
23
|
+
*/
|
|
24
|
+
vals?: (string | number)[];
|
|
25
|
+
/**
|
|
26
|
+
* 文字颜色值
|
|
27
|
+
*/
|
|
28
|
+
color?: string;
|
|
29
|
+
/**
|
|
30
|
+
* 背景颜色
|
|
31
|
+
*/
|
|
32
|
+
bgColor?: string;
|
|
33
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare type MD5 = {
|
|
2
|
+
/**
|
|
3
|
+
* MD5 加密
|
|
4
|
+
* @param str
|
|
5
|
+
*/
|
|
6
|
+
encode(str: string): string | null | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* hmac_md5 加密
|
|
9
|
+
* @param key 加密密钥
|
|
10
|
+
* @param str 加密内容
|
|
11
|
+
*/
|
|
12
|
+
hmac_md5(key: string, str: string): string | null | undefined;
|
|
13
|
+
};
|
|
14
|
+
declare const _MD5_: MD5;
|
|
15
|
+
export default _MD5_;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export declare class RTCHttpHeader {
|
|
2
|
+
private store;
|
|
3
|
+
getHeader(name: string): any;
|
|
4
|
+
addHeader(name: string, value: string | number): void;
|
|
5
|
+
getHeaderNames(): string[];
|
|
6
|
+
removeHeader(name: string): void;
|
|
7
|
+
values(): string[];
|
|
8
|
+
has(name: string): boolean;
|
|
9
|
+
entries(): [string, any][];
|
|
10
|
+
}
|
|
11
|
+
export declare class HttpResult {
|
|
12
|
+
private headers;
|
|
13
|
+
private responseData;
|
|
14
|
+
private statusCode;
|
|
15
|
+
private statusMsg;
|
|
16
|
+
constructor(props: {
|
|
17
|
+
headers: Record<string, string>;
|
|
18
|
+
statusCode: number;
|
|
19
|
+
statusMsg: string;
|
|
20
|
+
responseData: Int8Array | null;
|
|
21
|
+
config: any;
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* 获取HTTP响应头
|
|
25
|
+
*/
|
|
26
|
+
getHeaders(): Record<any, string>;
|
|
27
|
+
/**
|
|
28
|
+
* 指定获取响应头
|
|
29
|
+
* @param name
|
|
30
|
+
*/
|
|
31
|
+
getHeader(name: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* 获取响应状态码
|
|
34
|
+
*/
|
|
35
|
+
getStatusCode(): number;
|
|
36
|
+
/**
|
|
37
|
+
* 获取状态码消息
|
|
38
|
+
*/
|
|
39
|
+
getStatusMsg(): string;
|
|
40
|
+
/**
|
|
41
|
+
* 获取获取响应文本
|
|
42
|
+
*/
|
|
43
|
+
getResponseText(): string | null;
|
|
44
|
+
/**
|
|
45
|
+
* 获取响应数据流
|
|
46
|
+
*/
|
|
47
|
+
getResponseData(): Int8Array | null;
|
|
48
|
+
}
|
|
49
|
+
export type HttpRequestConfig = {};
|
|
50
|
+
export declare class RTCHttpClient {
|
|
51
|
+
private readonly id;
|
|
52
|
+
constructor(props: HttpRequestConfig);
|
|
53
|
+
getId(): string;
|
|
54
|
+
/**
|
|
55
|
+
* post 请求
|
|
56
|
+
* @param url
|
|
57
|
+
* @param data 请求数据
|
|
58
|
+
* @param params url 参数
|
|
59
|
+
* @param headers 自定义请求头
|
|
60
|
+
*/
|
|
61
|
+
post(url: string, data?: any, params?: Record<any, any>, headers?: Record<any, string>): Promise<HttpResult>;
|
|
62
|
+
/**
|
|
63
|
+
* get 请求
|
|
64
|
+
* @param url
|
|
65
|
+
* @param params
|
|
66
|
+
* @param headers
|
|
67
|
+
*/
|
|
68
|
+
get(url: string, params?: Record<any, any>, headers?: Record<any, string>): Promise<HttpResult>;
|
|
69
|
+
request(params: {
|
|
70
|
+
url: string;
|
|
71
|
+
method?: string | "GET";
|
|
72
|
+
params?: Record<string, any>;
|
|
73
|
+
data?: any;
|
|
74
|
+
headers?: Record<string, string>;
|
|
75
|
+
}): Promise<HttpResult>;
|
|
76
|
+
}
|
|
77
|
+
export declare const instance: (config: HttpRequestConfig) => RTCHttpClient;
|
|
78
|
+
export declare function request(params: {
|
|
79
|
+
url: string;
|
|
80
|
+
method?: string | "GET";
|
|
81
|
+
params?: Record<string, any>;
|
|
82
|
+
data?: any;
|
|
83
|
+
headers?: Record<string, string>;
|
|
84
|
+
}, config?: HttpRequestConfig): Promise<HttpResult>;
|
|
85
|
+
declare const defaults: RTCHttpClient;
|
|
86
|
+
export default defaults;
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
declare type any_str = string | undefined | null;
|
|
2
|
+
/**
|
|
3
|
+
* 年份
|
|
4
|
+
*/
|
|
5
|
+
declare type year = number;
|
|
6
|
+
/**
|
|
7
|
+
* 月数
|
|
8
|
+
*/
|
|
9
|
+
declare type moth = number;
|
|
10
|
+
/**
|
|
11
|
+
* 天数
|
|
12
|
+
*/
|
|
13
|
+
declare type day = number;
|
|
14
|
+
/**
|
|
15
|
+
* 0=trim左右空白
|
|
16
|
+
* 1=trim左边空白
|
|
17
|
+
* 2=trim右边空白
|
|
18
|
+
*/
|
|
19
|
+
declare type TrimMode = 0 | 1 | 2;
|
|
20
|
+
export type TreeNodeEF = {
|
|
21
|
+
__level__: number;
|
|
22
|
+
__isRoot__: boolean;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* @param curr 当前项
|
|
26
|
+
* @param parent 父项
|
|
27
|
+
* @param idx 当前项目所在列表中的索引
|
|
28
|
+
* @param arr 当前项所在的列表对象
|
|
29
|
+
*/
|
|
30
|
+
export type EachTreeProcesstor<T> = {
|
|
31
|
+
(curr: T, parent: T | null, idx: number, arr: T[]): any;
|
|
32
|
+
};
|
|
33
|
+
export type URI = {
|
|
34
|
+
"source": string | "";
|
|
35
|
+
"protocol": string | "";
|
|
36
|
+
"authority": string | "";
|
|
37
|
+
"userInfo": string | "";
|
|
38
|
+
"user": string | "";
|
|
39
|
+
"password": string | "";
|
|
40
|
+
"host": string | "";
|
|
41
|
+
"port": string | "";
|
|
42
|
+
"relative": string | "";
|
|
43
|
+
"path": string | "";
|
|
44
|
+
"directory": string | "";
|
|
45
|
+
"file": string | "";
|
|
46
|
+
"query": string | "";
|
|
47
|
+
anchor: string | "";
|
|
48
|
+
"origin": string | "";
|
|
49
|
+
params: {
|
|
50
|
+
[key: string]: string | boolean | any[] | "";
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export declare type Utils = {
|
|
54
|
+
/**
|
|
55
|
+
* 获取对象类型;
|
|
56
|
+
* <p>
|
|
57
|
+
* 例如:
|
|
58
|
+
* <pre>
|
|
59
|
+
* // type('123') 则返回 String
|
|
60
|
+
* // type(133) 则返回 Number
|
|
61
|
+
* // type([]) 则返回 Array
|
|
62
|
+
* // type() 则返回 Undefined
|
|
63
|
+
* // type(null) 则返回 null
|
|
64
|
+
* </pre>
|
|
65
|
+
*
|
|
66
|
+
* @param obj
|
|
67
|
+
*/
|
|
68
|
+
type(obj: any): string;
|
|
69
|
+
/**
|
|
70
|
+
* 是否为 String 类型
|
|
71
|
+
* @param obj
|
|
72
|
+
*/
|
|
73
|
+
isString(obj: any): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* 判断对象是否为 函数类型
|
|
76
|
+
* @param obj
|
|
77
|
+
*/
|
|
78
|
+
isFunction(obj: any): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* 获取字符串中包含的中文个数
|
|
81
|
+
* @param obj
|
|
82
|
+
*/
|
|
83
|
+
chineseLen(obj: any_str): number;
|
|
84
|
+
/**
|
|
85
|
+
* 将字符串去空白
|
|
86
|
+
* @param str
|
|
87
|
+
* @param flag
|
|
88
|
+
*/
|
|
89
|
+
trim(str: any_str, flag?: TrimMode): string | any;
|
|
90
|
+
/**
|
|
91
|
+
* 最忌打乱数组顺序
|
|
92
|
+
* @param arr
|
|
93
|
+
*/
|
|
94
|
+
shuffle<T>(arr: T[] | any): T[] | any;
|
|
95
|
+
/**
|
|
96
|
+
* 生成UUID
|
|
97
|
+
*/
|
|
98
|
+
uuid(): string;
|
|
99
|
+
/**
|
|
100
|
+
* 获取随机数, 默认 字母+数组
|
|
101
|
+
* @param len 随机数长度
|
|
102
|
+
* @param typeOrSource 随机数类型:1=字母+数字, 2=数字 , 3=字母,或者数据元
|
|
103
|
+
*/
|
|
104
|
+
random(len?: number, typeOrSource?: 1 | 2 | 3 | (number | string)[] | string): string;
|
|
105
|
+
/**
|
|
106
|
+
* 数据进行分页
|
|
107
|
+
* <pre>
|
|
108
|
+
* // pageNo,从1开始, 如果指定 分页页码返回指定页码 的数据,默认返回全部数据
|
|
109
|
+
* page([1,2,3,4,5,6,7,8,9,10], 3) // 返回 [[1,2,3],[4,5,6],[7,8,9],[10]]
|
|
110
|
+
* page([1,2,3,4,5,6,7,8,9,10], 3, 3) // 返回 [[7,8,9]]
|
|
111
|
+
* </pre>
|
|
112
|
+
* @param arr 数据列表
|
|
113
|
+
* @param pageSize 分页大小
|
|
114
|
+
* @param pageNo 获取第几页的数据,从1开始,默认返回全部数据,如果指定 分页页码返回指定页码 的数据,
|
|
115
|
+
*/
|
|
116
|
+
page<T = any>(arr: T[], pageSize: number, pageNo?: number): T[][];
|
|
117
|
+
/**
|
|
118
|
+
* 获取 URL 路径中的参数
|
|
119
|
+
* @param url
|
|
120
|
+
* @param key
|
|
121
|
+
*/
|
|
122
|
+
getUrlParam(url: string, key: string): string | null | any;
|
|
123
|
+
/**
|
|
124
|
+
* 获取 URL 路径中的所有参数
|
|
125
|
+
* @param url
|
|
126
|
+
*/
|
|
127
|
+
getUrlParams(url: string): Record<string, string | null> | object;
|
|
128
|
+
/**
|
|
129
|
+
* 获取 URL 路径中的 search 值
|
|
130
|
+
* @param url
|
|
131
|
+
*/
|
|
132
|
+
/**
|
|
133
|
+
* 给定uri 解析
|
|
134
|
+
* @param source
|
|
135
|
+
*/
|
|
136
|
+
parseUri(source: string | ""): URI;
|
|
137
|
+
/**
|
|
138
|
+
* 解析url查询参数 并封装为 参数 对象
|
|
139
|
+
* @param search
|
|
140
|
+
*/
|
|
141
|
+
parseQuery(search: string | ""): {
|
|
142
|
+
[key: string]: string | boolean | any[] | "";
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* 获取查询参数
|
|
146
|
+
* @param search 查询参数,如果为空则会 从url 读取
|
|
147
|
+
* @param allowFromLocation 允许从 location 上获取
|
|
148
|
+
*/
|
|
149
|
+
getQueryParams(search?: string, allowFromLocation?: boolean): Record<any, string | number | boolean | null> | object;
|
|
150
|
+
/**
|
|
151
|
+
* 字符串是否全部是中文
|
|
152
|
+
* @param obj
|
|
153
|
+
*/
|
|
154
|
+
isChinese(obj: any_str): boolean;
|
|
155
|
+
/**
|
|
156
|
+
* 是否为数组类型
|
|
157
|
+
* @param obj
|
|
158
|
+
*/
|
|
159
|
+
isArray(obj: any): boolean;
|
|
160
|
+
/**
|
|
161
|
+
* 判断是否为空 支持对象 字符串,map set array 等
|
|
162
|
+
* @param str
|
|
163
|
+
*/
|
|
164
|
+
isEmpty(str: any): boolean;
|
|
165
|
+
/**
|
|
166
|
+
* 判断是否为空
|
|
167
|
+
* @param str
|
|
168
|
+
*/
|
|
169
|
+
isBlank(str: any): boolean;
|
|
170
|
+
/**
|
|
171
|
+
* 是否为手机号
|
|
172
|
+
* @param str
|
|
173
|
+
*/
|
|
174
|
+
isMobile(str: any_str): boolean;
|
|
175
|
+
/**
|
|
176
|
+
* 判断是否是安卓设备
|
|
177
|
+
*/
|
|
178
|
+
isAndroid(): boolean;
|
|
179
|
+
/**
|
|
180
|
+
* 是否为闰年
|
|
181
|
+
* @param str yyyy格式
|
|
182
|
+
*/
|
|
183
|
+
isLeapYear(str: number | string): boolean;
|
|
184
|
+
/**
|
|
185
|
+
* 校验非法字符
|
|
186
|
+
* @param str
|
|
187
|
+
*/
|
|
188
|
+
isScript(str: string): boolean;
|
|
189
|
+
/**
|
|
190
|
+
* 判断是否为 身份证
|
|
191
|
+
* @param obj
|
|
192
|
+
*/
|
|
193
|
+
isIDCard(obj: string): boolean;
|
|
194
|
+
/**
|
|
195
|
+
* 从身份证获取年龄
|
|
196
|
+
* @param obj
|
|
197
|
+
*/
|
|
198
|
+
getAgeFromIDcard(obj: string): [year, moth, day] | [];
|
|
199
|
+
/**
|
|
200
|
+
* 判断是否为URL 这里只判断 str 必须有协议部分,比如:http://baidu.com 则返回true, //baidu.com 或者 baidu.com 返回false
|
|
201
|
+
* @param str
|
|
202
|
+
*/
|
|
203
|
+
isUrl(str: any_str): boolean;
|
|
204
|
+
/**
|
|
205
|
+
* 判断 是否为http
|
|
206
|
+
* @param str
|
|
207
|
+
*/
|
|
208
|
+
isHttp(str: any_str): boolean;
|
|
209
|
+
/**
|
|
210
|
+
* 判断是否为 https
|
|
211
|
+
* @param str
|
|
212
|
+
*/
|
|
213
|
+
isHttps(str: any_str): boolean;
|
|
214
|
+
/**
|
|
215
|
+
* 是否为IP V6
|
|
216
|
+
* @param str
|
|
217
|
+
*/
|
|
218
|
+
isIPv6(str: any_str): boolean;
|
|
219
|
+
isIPv4(str: any_str): boolean;
|
|
220
|
+
/**
|
|
221
|
+
* 获取当前IP
|
|
222
|
+
* @param str
|
|
223
|
+
* @param v6
|
|
224
|
+
*/
|
|
225
|
+
isIP(str: any_str, v6?: boolean): boolean;
|
|
226
|
+
/**
|
|
227
|
+
* 构建树型结构
|
|
228
|
+
* @param arr 数据列表
|
|
229
|
+
* @param idField id 唯一标识节点名称
|
|
230
|
+
* @param parentField 父级节点名称
|
|
231
|
+
* @param childrenField 子节点名称
|
|
232
|
+
*/
|
|
233
|
+
buildTree<T, R = T & TreeNodeEF>(arr: T[], idField?: "id", parentField?: "parentId", childrenField?: "children"): R[];
|
|
234
|
+
/**
|
|
235
|
+
* 遍历树节点
|
|
236
|
+
* @param arr
|
|
237
|
+
* @param processter
|
|
238
|
+
* @param childrenKey
|
|
239
|
+
*/
|
|
240
|
+
eachTree<T, R = T>(arr: T[], processter: EachTreeProcesstor<T>, childrenKey?: string | 'children'): R[];
|
|
241
|
+
/**
|
|
242
|
+
* 输转 数组
|
|
243
|
+
* @param arr
|
|
244
|
+
* @param childrenKey
|
|
245
|
+
* @param removeChildren 是否删除 children 节点
|
|
246
|
+
*/
|
|
247
|
+
treeToArray<T>(arr: T[] | T, childrenKey?: string, removeChildren?: boolean): T[];
|
|
248
|
+
/**
|
|
249
|
+
* 查找 树节点 只返回一项
|
|
250
|
+
* @param treeList
|
|
251
|
+
* @param filter
|
|
252
|
+
* @param childrenKey
|
|
253
|
+
*/
|
|
254
|
+
findTreeItem<T>(treeList: T[], filter: (c: T, p: T | null) => boolean, childrenKey?: string | ((c: T) => T[])): T | null;
|
|
255
|
+
};
|
|
256
|
+
export declare function uuid(len: number): string;
|
|
257
|
+
declare const _Utils_: Utils;
|
|
258
|
+
export default _Utils_;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare type IpRet = {
|
|
2
|
+
public: IpItem[];
|
|
3
|
+
private: IpItem[];
|
|
4
|
+
};
|
|
5
|
+
declare type IpItem = {
|
|
6
|
+
ip: string;
|
|
7
|
+
IPv4: boolean;
|
|
8
|
+
type: "public" | "private" | "IPv6";
|
|
9
|
+
};
|
|
10
|
+
export declare type WebRTCIP = {
|
|
11
|
+
/**
|
|
12
|
+
* 获取IP信息W
|
|
13
|
+
* @param timeout 超时时间
|
|
14
|
+
*/
|
|
15
|
+
getIPs(timeout?: number): Promise<IpRet>;
|
|
16
|
+
};
|
|
17
|
+
declare const _WebRTCIP_: WebRTCIP;
|
|
18
|
+
export default _WebRTCIP_;
|