jinbi-utils 1.0.19 → 1.0.21

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.
Files changed (81) hide show
  1. package/.babelrc +19 -0
  2. package/.cz-config.js +55 -0
  3. package/.dockerignore +3 -0
  4. package/.editorconfig +12 -0
  5. package/.eslintignore +8 -0
  6. package/.eslintrc.js +54 -0
  7. package/.versionrc.json +9 -0
  8. package/CHUNK_OPTIMIZER_USAGE.md +132 -0
  9. package/Dockerfile +3 -0
  10. package/QUICK_RELEASE.md +85 -0
  11. package/RELEASE_GUIDE.md +243 -0
  12. package/api-extractor.json +15 -0
  13. package/commitlint.config.js +3 -0
  14. package/jest.config.js +15 -0
  15. package/package.json +8 -35
  16. package/rollup.config.chunk-optimizer.js +32 -0
  17. package/rollup.config.js +73 -0
  18. package/src/array/index.ts +85 -0
  19. package/src/build/chunk-optimizer/ARCHITECTURE.md +347 -0
  20. package/src/build/chunk-optimizer/QUICK_START.md +370 -0
  21. package/src/build/chunk-optimizer/README.md +240 -0
  22. package/src/build/chunk-optimizer/core/chunk-generator.ts +166 -0
  23. package/src/build/chunk-optimizer/core/classifier.ts +148 -0
  24. package/src/build/chunk-optimizer/core/dependency-reader.ts +138 -0
  25. package/src/build/chunk-optimizer/examples/basic-usage.ts +234 -0
  26. package/src/build/chunk-optimizer/index.ts +166 -0
  27. package/src/build/chunk-optimizer/rules/common-rules.ts +131 -0
  28. package/src/build/chunk-optimizer/rules/framework-rules.ts +93 -0
  29. package/src/build/chunk-optimizer/rules/index.ts +27 -0
  30. package/src/build/chunk-optimizer/test.ts +94 -0
  31. package/src/build/chunk-optimizer/types.ts +128 -0
  32. package/src/color/index.ts +58 -0
  33. package/src/common/index.ts +353 -0
  34. package/src/constant/common.constant.ts +13 -0
  35. package/src/date/index.ts +143 -0
  36. package/src/dom/index.ts +198 -0
  37. package/src/file/index.ts +319 -0
  38. package/src/http/apiBuilder/README.md +648 -0
  39. package/src/http/apiBuilder/api-builder.ts +502 -0
  40. package/src/http/apiBuilder/example.ts +243 -0
  41. package/src/http/apiBuilder/index.ts +1 -0
  42. package/src/http/apiBuilder//345/277/253/351/200/237/345/217/202/350/200/203.md +199 -0
  43. package/src/http/http.ts +79 -0
  44. package/src/http/httpEnums.ts +61 -0
  45. package/src/iam/index.ts +46 -0
  46. package/src/index.ts +20 -0
  47. package/src/middleware/requestLogger.middware.ts +371 -0
  48. package/src/middleware/requestLoggerUnified.ts +371 -0
  49. package/src/number/index.ts +362 -0
  50. package/src/object/index.ts +54 -0
  51. package/src/print/index.ts +102 -0
  52. package/src/string/index.ts +189 -0
  53. package/src/utils/curl.ts +108 -0
  54. package/src/validate/index.ts +100 -0
  55. package/src/websocket/emitter.ts +39 -0
  56. package/src/websocket/index.ts +6 -0
  57. package/src/websocket/manager.ts +151 -0
  58. package/src/websocket/pinia-store.ts +91 -0
  59. package/src/websocket/service.ts +34 -0
  60. package/src/websocket/types.ts +45 -0
  61. package/test/common/index.test.ts +19 -0
  62. package/test/date/index.test.ts +107 -0
  63. package/test/file/index.test.ts +104 -0
  64. package/test/number/index.test.ts +108 -0
  65. package/test/object/index.test.ts +20 -0
  66. package/test/string/index.test.ts +82 -0
  67. package/tsconfig.json +39 -0
  68. package/typedoc.json +12 -0
  69. package/types/file/index.d.ts +7 -0
  70. package/types/index.d.ts +1 -0
  71. package/types/websocket/emitter.d.ts +16 -0
  72. package/types/websocket/index.d.ts +6 -0
  73. package/types/websocket/manager.d.ts +36 -0
  74. package/types/websocket/pinia-store.d.ts +25 -0
  75. package/types/websocket/service.d.ts +13 -0
  76. package/types/websocket/types.d.ts +34 -0
  77. package/dist/chunk-optimizer.cjs +0 -703
  78. package/dist/index.esm.js +0 -2791
  79. package/dist/index.esm.min.js +0 -15
  80. package/dist/index.umd.js +0 -2899
  81. package/dist/index.umd.min.js +0 -16
@@ -1,16 +0,0 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("axios"),require("child_process")):"function"==typeof define&&define.amd?define(["exports","axios","child_process"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["jinbi-utils"]={},t.axios,t.child_process)}(this,(function(t,e,r){"use strict";function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var o={isWxWork:"wecom",isWeixin:"wechat",isMobile:"mobile",isMobileAny:"mobile"};function i(t){return null===t||""===t||void 0===t}var a=function(){var t=navigator.userAgent.toLowerCase(),e=/wxwork/.test(t),r=/micromessenger/.test(t)&&!e,n=window.innerWidth<=768;return{isWxWork:e,isWeixin:r,isMobileScreen:n,isMobileAny:e||r||n}},u=function(t){var e="wecom";for(var r in t){if(t[r]){e=o[r];break}}return e};var s=function(t,e){var r=t.toLowerCase();return"localstorage"===r?localStorage.getItem("token")||"":"sessionstorage"===r?sessionStorage.getItem("token")||"":localStorage.getItem("token")||sessionStorage.getItem("token")||""},c=function(t,e){var r=t.toLowerCase();"localstorage"===r?localStorage.removeItem("token"):"sessionstorage"===r?sessionStorage.removeItem("token"):(localStorage.removeItem("token"),sessionStorage.getItem("token"))};function l(t){return"string"==typeof t?t.replace(/-/g,"/"):t}function f(t,e){void 0===t&&(t=Date.now()),void 0===e&&(e="yyyy-MM-dd HH:mm:ss"),t=l(t);var r={"M+":(t=new Date(t)).getMonth()+1,"d+":t.getDate(),"h+":t.getHours()%12==0?12:t.getHours()%12,"H+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),"q+":Math.floor((t.getMonth()+3)/3),S:t.getMilliseconds()};return/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(""+t.getFullYear()).substr(4-RegExp.$1.length))),Object.keys(r).forEach((function(t){new RegExp("("+t+")").test(e)&&(e=e.replace(RegExp.$1,1===RegExp.$1.length?r[t]:("00"+r[t]).substr((""+r[t]).length)))})),e}
2
- /*! *****************************************************************************
3
- Copyright (c) Microsoft Corporation.
4
-
5
- Permission to use, copy, modify, and/or distribute this software for any
6
- purpose with or without fee is hereby granted.
7
-
8
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
- PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */
16
- var d=function(t,e){return(d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)};function p(t,e){function r(){this.constructor=t}d(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var h=function(){return(h=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function v(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))}function g(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function m(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var i=arguments[e],a=0,u=i.length;a<u;a++,o++)n[o]=i[a];return n}var y={operation:"divide",factor:100,precision:2,formatAsCurrency:!1,currencySymbol:"¥"};function w(t,e){if(void 0===e&&(e="-"),i(t))return e;var r=t.toString();return r.includes(".")||(r+="."),r.replace(/\d(?=(\d{3})+\.)/g,(function(t){return t+","})).replace(/\.$/,"")}function b(t,e){if(void 0===e&&(e=0),i(t))return t;var r=Math.pow(10,e),n=Number(t)*r;return Math.ceil(n)/r}function S(t,e){var r=A(t,e),n=h(h({},y),e);if(n.formatter)return n.formatter(r);if(n.formatAsCurrency){var o=r.toFixed(n.precision),i=r>=1e3?w(o):o;return""+n.currencySymbol+i}return r.toFixed(n.precision)}function A(t,e){var r,n,o=h(h({},y),e);if(null==t||""===t)return 0;if("string"==typeof t){var i=t.replace(/[^\d.-]/g,"");r=i?parseFloat(i):0}else r=t;if(isNaN(r))return 0;if(n="multiply"===o.operation?r*o.factor:0!==o.factor?r/o.factor:0,void 0!==o.precision){var a=Math.pow(10,o.precision);n=Math.round(n*a)/a}return n}function M(t,e){void 0===e&&(e="B");var r=["B","KB","MB","GB","TB"],n=r.indexOf(e.toUpperCase());for(n=-1===n?0:n;t>=1024&&n<r.length;)t/=1024,n+=1;return{size:t,unit:r[n]}}function x(t){for(var e=t.match(/:(.*?);/)[1],r=window.atob(t.split(",")[1]),n=new ArrayBuffer(r.length),o=new Uint8Array(n),i=0;i<r.length;i+=1)o[i]=r.charCodeAt(i);return new Blob([n],{type:e})}function C(t){return new Promise((function(e,r){var n=new FileReader;n.onload=function(t){t&&t.target?e(t.target.result):r(t)},n.onerror=function(t){r(t)},n.readAsDataURL(t)}))}function T(t,e,r,n,o){if(void 0===o&&(o=[]),o.push(t),t[r]===e)throw"GOT IT!";if(t[n]&&t[n].length>0)for(var i=0;i<t[n].length;i++)T(t[n][i],e,r,n,o);o.pop()}var k={HTTP_STATUS:{TEMP_RESPOND:{Continue:100,SwitchingProtocal:101},SUCCESS:{Ok:200,Created:201,Accepted:202,NoAuthoritativeInformation:203,NoContent:204,ResetContent:205,ParticalContent:206},REDIRECT:{MultipleChoice:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,TemporaryRedirect:307,PermanentRedirect:308},REQUEST_ERROR:{BadRequest:400,UnAuthorized:401,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAccepted:406,ProxyAuthorizationRequired:407,RequestTimeout:408,UpgradeRequired:426,TokenUnAuthorized:499},SERVER_ERROR:{InternalServerError:500,BadGateway:502,ServiceUnavailable:503,GateTimeout:504,HttpVersionNotSupported:505}},CODES:{Success:"00000",UnAuthorized:"00099",UnAuthorizedPhone:"11001",UnAuthorizedWecom:"11000",UnAuthorizedHavePhone:"11002"},ERR_CODE_WHITE_LIST:[]},E=n(e).default.create({timeout:15e3,headers:{"Content-Type":"application/json"}}),O=function(){function t(t){this.fieldCatalog=t,this.params=t?{field_catalog:t}:{}}return t.prototype.build=function(){return this.params},t}(),B=function(){function t(t){this.fieldCatalog=t}return t.prototype.query=function(){return new N(this.fieldCatalog)},t.prototype.insert=function(){return new R(this.fieldCatalog)},t.prototype.update=function(){return new j(this.fieldCatalog)},t.query=function(t){return new N(t)},t.insert=function(t){return new R(t)},t.update=function(t){return new j(t)},t}(),I=function(){function t(t,e){this.parent=e,this.nestedFilters={logic:t,filters:[]}}return t.prototype.where=function(t,e,r){var n=this;return"object"==typeof t?(Object.entries(t).forEach((function(t){var e=t[0],r=t[1];n.nestedFilters.filters.push({field:e,op:"=",value:r})})),this):void 0===r?(this.nestedFilters.filters.push({field:t,op:"=",value:e}),this):(this.nestedFilters.filters.push({field:t,op:e,value:r}),this)},t.prototype.group=function(e){return void 0===e&&(e="and"),new t(e,this)},t.prototype.endGroup=function(){return this.parent instanceof t?(this.parent.addNestedFilters(this.nestedFilters),this.parent):(this.parent.whereNested(this.nestedFilters),this.parent)},t.prototype.addNestedFilters=function(t){this.nestedFilters.filters.push(t)},t.prototype.build=function(){return this.nestedFilters},t}(),N=function(t){function e(e){var r=t.call(this,e)||this;return r.params=h(h({},r.params),{filters:{logic:"and",filters:[]},order_by:[],limit:100,offset:0}),r}return p(e,t),e.prototype.where=function(t,e,r){var n=this;return"object"==typeof t?(Object.entries(t).forEach((function(t){var e=t[0],r=t[1];n.params.filters.filters.push({field:e,op:"=",value:r})})),this):void 0===r?(this.params.filters.filters.push({field:t,op:"=",value:e}),this):(this.params.filters.filters.push({field:t,op:e,value:r}),this)},e.prototype.whereNested=function(t){return this.params.filters.filters.push(t),this},e.prototype.group=function(t){return void 0===t&&(t="and"),new I(t,this)},e.prototype.orWhere=function(t,e,r){var n,o={logic:"or",filters:[]};if("object"==typeof t?Object.entries(t).forEach((function(t){var e=t[0],r=t[1];o.filters.push({field:e,op:"=",value:r})})):void 0===r?o.filters.push({field:t,op:"=",value:e}):o.filters.push({field:t,op:e,value:r}),0===this.params.filters.filters.length||"or"===this.params.filters.logic)(n=this.params.filters.filters).push.apply(n,o.filters),this.params.filters.logic="or";else{var i={logic:"and",filters:m(this.params.filters.filters)};this.params.filters.filters=[i,o],this.params.filters.logic="and"}return this},e.prototype.whereIn=function(t,e){return this.params.filters.filters.push({field:t,op:"in",value:e}),this},e.prototype.whereNotIn=function(t,e){return this.params.filters.filters.push({field:t,op:"not in",value:e}),this},e.prototype.whereLike=function(t,e){return this.params.filters.filters.push({field:t,op:"like",value:e}),this},e.prototype.whereBetween=function(t,e,r){return this.params.filters.filters.push({field:t,op:"between",value:[e,r]}),this},e.prototype.whereNull=function(t){return this.params.filters.filters.push({field:t,op:"is null",value:null}),this},e.prototype.whereNotNull=function(t){return this.params.filters.filters.push({field:t,op:"is not null",value:null}),this},e.prototype.logic=function(t){return this.params.filters.logic=t,this},e.prototype.orderBy=function(t,e){return void 0===e&&(e="asc"),this.params.order_by.push({field:t,direction:e}),this},e.prototype.limit=function(t){return this.params.limit=t,this},e.prototype.offset=function(t){return this.params.offset=t,this},e.prototype.paginate=function(t,e){return void 0===e&&(e=0),this.params.limit=t,this.params.offset=e,this},e}(O),R=function(t){function e(e){var r=t.call(this,e)||this;return r.params=h(h({},r.params),{insert:[]}),r}return p(e,t),e.prototype.add=function(t){return this.params.insert.push(t),this},e.prototype.addBatch=function(t){var e;return(e=this.params.insert).push.apply(e,t),this},e}(O),j=function(t){function e(e){var r=t.call(this,e)||this;return r.currentUpdate=null,r.params=h(h({},r.params),{update:[]}),r}return p(e,t),e.prototype.set=function(t){return this.currentUpdate={set:t,where:{}},this},e.prototype.where=function(t,e){if(!this.currentUpdate)throw new Error("必须先调用 set() 方法");return"object"==typeof t?this.currentUpdate.where=h(h({},this.currentUpdate.where),t):this.currentUpdate.where[t]=e,this},e.prototype.and=function(){return this.currentUpdate&&(this.params.update.push(this.currentUpdate),this.currentUpdate=null),this},e.prototype.setBatch=function(t){var e;return(e=this.params.update).push.apply(e,t),this},e.prototype.build=function(){return this.currentUpdate&&(this.params.update.push(this.currentUpdate),this.currentUpdate=null),this.params},e}(O);var q=new(function(){function t(){}return t.prototype.request=function(t){return v(this,void 0,void 0,(function(){var e,n;return g(this,(function(o){switch(o.label){case 0:return e=function(t){var e=["-sS","-i"],r=(t.method||"GET").toUpperCase();"GET"!==r&&e.push("-X",r);var n=h({},t.headers||{}),o=Object.keys(n).some((function(t){return"content-type"===t.toLowerCase()})),i=void 0!==t.data&&null!==t.data;i&&!o&&(n["Content-Type"]="application/json");for(var a=0,u=Object.keys(n);a<u.length;a++){var s=u[a];e.push("-H",s+": "+n[s])}if(i){var c=void 0;c=Buffer.isBuffer(t.data)?t.data.toString():"string"==typeof t.data?t.data:JSON.stringify(t.data),e.push("--data",c)}!1!==t.followRedirects&&e.push("-L");var l="number"==typeof t.timeoutMs&&t.timeoutMs>0?t.timeoutMs:15e3;return e.push("--max-time",String(Math.ceil(l/1e3))),e.push(t.url),e}(t),n="win32"===process.platform?"curl.exe":"curl",[4,new Promise((function(t,o){var i=r.spawn(n,e,{stdio:["ignore","pipe","pipe"]}),a="",u="";i.stdout.on("data",(function(t){a+=t.toString()})),i.stderr.on("data",(function(t){u+=t.toString()})),i.on("error",(function(t){return o(t)})),i.on("close",(function(e){if(0!==e&&!a)return o(new Error(u||"curl exit "+e));try{t(function(t){var e,r=t.indexOf("\r\n\r\n")>=0?t.indexOf("\r\n\r\n"):t.indexOf("\n\n"),n=r>=0?t.substring(0,r):"",o=r>=0?t.substring(r+("\r\n\r\n"===t.substr(r,4)?4:2)):t,i=function(t){for(var e={},r=0,n=t.split(/\r?\n/);r<n.length;r++){var o=n[r],i=o.indexOf(":");if(i>0){var a=o.substring(0,i).trim(),u=o.substring(i+1).trim();a&&(e[a.toLowerCase()]=u)}}return e}(n),a=200,u=(n.split(/\r?\n/)[0]||"").match(/HTTP\/[0-9.]+\s+(\d{3})/);if(u&&(a=parseInt(u[1],10)),(i["content-type"]||"").includes("application/json"))try{e=JSON.parse(o)}catch(t){}return{status:a,headers:i,body:o,json:e}}(a))}catch(t){o(t)}}))}))];case 1:return[2,o.sent()]}}))}))},t.prototype.get=function(t,e){return v(this,void 0,void 0,(function(){return g(this,(function(r){return[2,this.request(h(h({},e||{}),{url:t,method:"GET"}))]}))}))},t.prototype.post=function(t,e,r){return v(this,void 0,void 0,(function(){return g(this,(function(n){return[2,this.request(h(h({},r||{}),{url:t,method:"POST",data:e}))]}))}))},t}());function D(){var t=new Date;return String(t.getFullYear())+"年"+String(t.getMonth()+1)+"月"+String(t.getDate())+"日"+String(t.getHours())+":"+String(t.getMinutes())}function U(t){return v(this,void 0,void 0,(function(){var e,r;return g(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),"https://fe-log-producer.jinbizhihui.com",[4,q.post("https://fe-log-producer.jinbizhihui.com/log/save",t)];case 1:return e=n.sent(),console.log("[RequestLogger] 远程日志发送成功, result",e),[3,3];case 2:return r=n.sent(),console.error("[RequestLogger] 远程日志发送失败:",(null==r?void 0:r.message)||r),[3,3];case 3:return[2]}}))}))}function F(t){return v(this,void 0,void 0,(function(){var e,r,n;return g(this,(function(o){switch(o.label){case 0:e=t.req.header("content-type")||"",o.label=1;case 1:return o.trys.push([1,4,,5]),(r=t.req.raw)&&"function"==typeof r.clone?[4,r.clone().text()]:[3,3];case 2:if(!(n=o.sent()))return[2,void 0];if(e.includes("application/json"))try{return[2,JSON.parse(n)]}catch(t){return[2,n]}return[2,n];case 3:return[3,5];case 4:return o.sent(),[3,5];case 5:return[2,void 0]}}))}))}function P(t){var e={};try{t.res.headers.forEach((function(t,r){e[r]=t}))}catch(t){}return e}function L(t,e,r){return v(this,void 0,void 0,(function(){var n,o,i,a,u,s,c,l,f,d;return g(this,(function(p){switch(p.label){case 0:return n=t.req.header("x-forwarded-for")||t.req.header("x-real-ip")||"unknown",o=t.req.method,i=t.req.url,a=t.req.query(),u=function(t){var e={};try{var r=t.req.raw,n=null==r?void 0:r.headers;n&&n.forEach((function(t,r){e[r]=t}))}catch(t){}return e}(t),[4,F(t)];case 1:return s=p.sent(),c=D(),l=Date.now(),[4,e()];case 2:return p.sent(),f=Date.now()-l,d={status:t.res.status,headers:P(t),duration:f},[4,U({system:r,ip:n,path:i,method:o,time:c,params:{method:o,url:i,query:a,body:s},headers:u,result:d})];case 3:return p.sent(),[2]}}))}))}function _(t){var e,r={};try{for(var n=(null===(e=t.response)||void 0===e?void 0:e.headers)||{},o=0,i=Object.entries(n);o<i.length;o++){var a=i[o],u=a[0],s=a[1];r[u]=String(s)}}catch(t){}return r}function z(t,e,r){var n,o,i,a,u,s;return v(this,void 0,void 0,(function(){var c,l,f,d,p,h,v,m,y,w,b;return g(this,(function(g){switch(g.label){case 0:return c=t.ip||(null===(n=t.request)||void 0===n?void 0:n.ip)||"unknown",l=t.path||(null===(o=t.request)||void 0===o?void 0:o.path)||"",f=t.method||(null===(i=t.request)||void 0===i?void 0:i.method)||"",d=t.url||(null===(a=t.request)||void 0===a?void 0:a.url)||"",p=t.query||(null===(u=t.request)||void 0===u?void 0:u.query)||{},h=(null===(s=t.request)||void 0===s?void 0:s.body)||{},v=function(t){var e,r={};try{for(var n=t.headers||(null===(e=t.request)||void 0===e?void 0:e.headers)||{},o=0,i=Object.entries(n);o<i.length;o++){var a=i[o],u=a[0],s=a[1];r[u]=String(s)}}catch(t){}return r}(t),m=D(),y=Date.now(),[4,e()];case 1:return g.sent(),w=Date.now()-y,b={status:t.status,body:t.body,headers:_(t),duration:w},[4,U({system:r,ip:c,path:l,method:f,time:m,params:{method:f,url:d,query:p,body:h},headers:v,result:b})];case 2:return g.sent(),[2]}}))}))}function H(t){var e,r={};try{for(var n=(null===(e=t.getHeaders)||void 0===e?void 0:e.call(t))||{},o=0,i=Object.entries(n);o<i.length;o++){var a=i[o],u=a[0],s=a[1];void 0!==s&&(r[u]=String(s))}}catch(t){}return r}function $(t,e,r){return v(this,void 0,void 0,(function(){var n,o,i,a,u,s,c,l,f,d;return g(this,(function(p){switch(p.label){case 0:return n=t.headers["x-forwarded-for"]||t.headers["x-real-ip"]||t.ip||"unknown",o=t.url||"",i=t.method||"",a=t.query||{},u=t.body||{},s=function(t){var e={};try{for(var r=t.headers||{},n=0,o=Object.entries(r);n<o.length;n++){var i=o[n],a=i[0],u=i[1];e[a]=String(u)}}catch(t){}return e}(t),c=D(),l=Date.now(),f=Date.now()-l,d={status:e.statusCode,headers:H(e),duration:f},[4,U({system:r,ip:n,path:o,method:i,time:c,params:{method:i,url:o,query:a,body:u},headers:s,result:d})];case 1:return p.sent(),[2]}}))}))}function W(t){var e=t.replace("#","").match(/../g);return e?e.map((function(t){return parseInt(t,16)})):[0,0,0]}function G(t,e,r){var n=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e};return"#"+n(t)+n(e)+n(r)}function Y(t,e){return!("undefined"==typeof window||!t)&&!!t.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}t.ApiBuilder=B,t.InsertBuilder=R,t.QueryBuilder=N,t.UpdateBuilder=j,t.addClass=function(t,e){"undefined"!=typeof window&&t&&(Y(t,e)||(t.className+=" "+e))},t.addDays=function(t,e,r){if(void 0===e&&(e=0),void 0===r&&(r="yyyy-MM-dd"),i(t))return"-";t=l(t);var n=new Date(t);return n.setDate(n.getDate()+Number(e)),f(n,r)},t.base64ToBlob=function(t){for(var e=t.split(","),r=e[0].match(/:(.\*?);/)[1],n=atob(e[1]),o=n.length,i=new Uint8Array(o);o--;)i[o]=n.charCodeAt(o);return new Blob([i],{type:r})},t.base64ToFile=function(t,e){for(var r=t.split(","),n=r[0].match(/:(.*);/)[1],o=atob(r[1]),i=o.length,a=new Uint8Array(i);i--;)a[i]=o.charCodeAt(i);return new File([a],e,{type:n})},t.blobToDataURL=C,t.buildUUID=function(){for(var t=[],e=0;e<=15;e++)t[e]=e.toString(16);var r="";for(e=1;e<=36;e++)r+=9===e||14===e||19===e||24===e?"-":15===e?4:20===e?t[4*Math.random()|8]:t[16*Math.random()|0];return r.replace(/-/g,"")},t.calcFileSize=M,t.ceil=b,t.clearLoginData=function(){localStorage.removeItem("wecom_userinfo"),localStorage.removeItem("wecom_token"),localStorage.removeItem("projectActive"),localStorage.removeItem("loginTime"),localStorage.removeItem("projectInfo")},t.compatibleDate=l,t.compressImg=function(t,e,r){return new Promise((function(n,o){var i=parseFloat((t.size/1024/1024).toString()),a=new FileReader;a.onload=function(a){var u=new Image;u.onload=function(){var o=u.width,a=u.height,s=document.createElement("canvas"),c=s.getContext("2d"),l=e?e(o,a):1;(Number.isNaN(l)||"number"!=typeof l)&&(l=1);var f=r?r(i,l,o,a):1;if((Number.isNaN(f)||"number"!=typeof f)&&(f=1),c){var d=parseInt((o*l).toString(),10),p=parseInt((a*l).toString(),10);s.setAttribute("width",d.toString()),s.setAttribute("height",p.toString()),c.drawImage(u,0,0,d,p)}var h=s.toDataURL(t.type,f);n(x(h))},u.onerror=function(t){o(t)},a.target&&(u.src=a.target.result)},a.onerror=function(t){o(t)},a.readAsDataURL(t)}))},t.computeMoney=A,t.convertBase64UrlToBlob=function(t){for(var e=window.atob(t.split(",")[1]),r=new ArrayBuffer(e.length),n=new Uint8Array(r),o=0;o<e.length;o++)n[o]=e.charCodeAt(o);return new Blob([r],{type:"image/png"})},t.convertCurrency=function(t){if(void 0===t&&(t=""),i(t))return"";if(Number(t)>=1e15)return t;var e,r,n,o=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],a=["","拾","佰","仟"],u=["","万","亿","兆"],s=["角","分","毫","厘"],c="";if("0"===(t=parseFloat(t).toString()))return c=o[0]+"元整";if(-1===(t=t.toString()).indexOf(".")?(e=t,r=""):(e=(n=t.split("."))[0],r=n[1].substr(0,4)),parseInt(e,10)>0){for(var l=0,f=e.length,d=0;d<f;d+=1){var p=e.substr(d,1),h=f-d-1,v=h/4,g=h%4;"0"===p?l+=1:(l>0&&(c+=o[0]),l=0,c+=o[parseInt(p,10)]+a[g]),0===g&&l<4&&(c+=u[v])}c+="元"}if(""!==r){var m=r.length;for(d=0;d<m;d+=1){var y=r.substr(d,1);"0"!==y&&(c+=o[Number(y)]+s[d])}}return""===c?c+=o[0]+"元整":""===r&&(c+="整"),c},t.copyTextToClipboard=function(t){if("undefined"==typeof window||"undefined"==typeof document)return!1;var e=document.createElement("textarea"),r=document.activeElement;e.value=t,e.setAttribute("readonly",""),e.style.position="absolute",e.style.left="-9999px",e.style.fontSize="12pt",e.style.border="0",e.style.padding="0",e.style.margin="0";var n=document.getSelection(),o=null;n&&n.rangeCount>0&&(o=n.getRangeAt(0)),document.body.appendChild(e),e.select(),e.selectionStart=0,e.selectionEnd=t.length;var i=!1;try{i=document.execCommand("copy")}catch(t){console.error("复制失败:",t)}return e.remove(),o&&n&&(n.removeAllRanges(),n.addRange(o)),r&&r.focus(),i},t.darken=function(t,e){var r=W(t).map((function(t){return Math.floor(t*(1-e))}));return G(r[0],r[1],r[2])},t.dataURLtoBlob=x,t.deepEqual=function t(e,r){var n=Object.keys,o=typeof e;return e&&r&&"object"===o&&o===typeof r?n(e).length===n(r).length&&n(e).every((function(n){return t(e[n],r[n])})):e===r},t.delay=function(t){return new Promise((function(e){return setTimeout(e,t)}))},t.deviceDetection=function(){if("undefined"==typeof window)return!1;var t=navigator.userAgent.toLowerCase(),e=/midp/i.test(t),r=/ucweb/i.test(t),n=/android/i.test(t),o=/iphone os/i.test(t),i=/windows ce/i.test(t),a=/windows mobile/i.test(t),u=/rv:1.2.3.4/i.test(t);return e||r||n||o||i||a||u},t.fileSizeFormat=function(t,e,r){if(void 0===e&&(e="B"),void 0===r&&(r="-"),i(t))return r;var n=M(parseFloat(t.toString()),e);return""+b(n.size,2)+n.unit},t.filterRepeat=function(t,e){var r=new Set;return t.filter((function(t){var n=t[e];return!r.has(n)&&(r.add(n),!0)}))},t.findNodePath=function(t,e,r,n){var o=[];try{for(var i=0;i<r.length;i++)T(r[i],t,e,n,o)}catch(t){return o}},t.floor=function(t,e){if(void 0===e&&(e=0),i(t))return t;var r=Math.pow(10,e),n=Number(t)*r;return Math.floor(n)/r},t.formatBank=function(t,e){return void 0===e&&(e=""),i(t)?e:t.toString().replace(/\s/g,"").replace(/(.{4})/g,"$1 ")},t.formatBytes=function(t,e){if(void 0===e&&(e=2),0===t)return"0 Bytes";var r=e<0?0:e,n=Math.floor(Math.log(t)/Math.log(1024));return parseFloat((t/Math.pow(1024,n)).toFixed(r))+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][n]},t.formatCentsToYuan=function(t,e){return S(t,h({operation:"divide",factor:100,formatAsCurrency:!0},e))},t.formatEmptyValue=function(t,e){return void 0===e&&(e="-"),i(t)?e:t},t.formatFloat=function(t,e){void 0===e&&(e=2);var r=parseFloat(String(t));if(Number.isNaN(r))return"";var n=(r=Math.round(Number(t)*Math.pow(10,e))/Math.pow(10,e)).toString(),o=n.indexOf(".");for(o<0&&(o=n.length,n+=".");n.length<=o+e;)n+="0";return n},t.formatMoney=S,t.formatPhone=function(t,e,r){if(void 0===e&&(e=" "),void 0===r&&(r="-"),i(t))return r;if(11!==t.toString().length)return t;var n=t.toString().replace(/[^\d]/g,"").split(""),o="";return n.forEach((function(t,r){3!==r&&7!==r||(o+=e),o+=t})),o},t.formatPhoneHide=function(t,e){if(void 0===e&&(e=""),i(t))return e;if(11!==t.toString().length)return t;var r=t.toString();return r.substr(0,3)+"****"+r.substr(7,11)},t.formatTime=f,t.formateTimestamp=function(t,e){if(void 0===e&&(e="YYYY年MM月DD日 hh:mm:ss"),!t)return"-";var r=new Date(t),n=r.getFullYear()+"",o=r.getMonth()+1,i=r.getDate(),a=r.getHours()>9?r.getHours():"0"+r.getHours(),u=r.getMinutes()>9?r.getMinutes():"0"+r.getMinutes(),s=r.getSeconds()>9?r.getSeconds():"0"+r.getSeconds();return e.replace("YYYY",n+"").replace("MM",o+"").replace("DD",i+"").replace("hh",a+"").replace("mm",u+"").replace("ss",s+"")},t.fromNow=function(t,e,r){if(void 0===e&&(e="yyyy年MM月dd日 HH时mm分ss秒"),void 0===r&&(r="-"),i(t))return r;t=l(t);var n=new Date(t),o=(Date.now()-n.getTime())/1e3;return o<0?t:o<30?"刚刚":o<3600?Math.ceil(o/60)+"分钟前":o<86400?Math.floor(o/3600)+"小时前":o<172800?"1天前":f(t,e)},t.genExportByBlob=function(t){var e=t.axiosRequest,r=t.notWithCredentials,n=void 0===r?[]:r;return function(t){var r=this,o=t.filename,i=t.url,a=t.data,u=void 0===a?{}:a,s=t.params,c=void 0===s?{}:s,l=t.method,f=void 0===l?"post":l;return new Promise((function(t,a){e({method:f,url:i,data:u,params:c,responseType:"blob",config:{withCredentials:n.some((function(t){return!i.includes(t)}))}}).then((function(e){return v(r,void 0,void 0,(function(){var r,n,i,u,s,c,l,f,d,p;return g(this,(function(h){switch(h.label){case 0:return"application/json"!==(r=null==e?void 0:e.data).type?[3,1]:((n=new FileReader).readAsText(r,"utf-8"),n.onload=function(){var t={};try{t=JSON.parse(n.result)}catch(e){t=r}a(t)},[3,3]);case 1:try{i=e.headers,u=i["content-disposition"],s=decodeURIComponent(u.split(";")[1].split("filename=")[1]),o&&!o.includes(".")?(c=s.split("."),l=c[c.length-1],o+="."+l):o||(o=s)}catch(t){o||(o="download.xlsx")}return f=new Blob([e.data]),d=document.createElement("a"),[4,C(f)];case 2:p=h.sent(),d.href=p,d.download=o,document.body.appendChild(d),d.click(),document.body.removeChild(d),t(e),h.label=3;case 3:return[2]}}))}))})).catch((function(t){a(t)}))}))}},t.generateEnglishLetters=function(){for(var t=[],e=65;e<91;e+=1)t.push(String.fromCharCode(e));return t},t.getCookie=function(t){for(var e="",r=document.cookie.split("; "),n=0;n<r.length;n++){var o=r[n].split("=");if(o[0]===t){e=o[1];break}}return e},t.getDeviceType=a,t.getEnvironment=function(){var t=window.navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i),e=/micromessenger/i.test(navigator.userAgent),r=/wxwork/i.test(navigator.userAgent);return r&&t?"com-wx-mobile":r&&!t?"com-wx-pc":e&&t?"wx-mobile":e&&!t?"wx-pc":"other"},t.getFileData=function(t){var e=t.split(","),r=e[0],n=void 0===r?"":r,o=e[1],i=void 0===o?"":o;return{name:decodeURIComponent(n),url:decodeURIComponent(i)}},t.getFromType=u,t.getIsComWx=function(){return/wxwork/i.test(navigator.userAgent)},t.getIsDevelopment=function(){var t=!1;return"uat2-h5-wecom.hengdayun.com"!==location.origin&&"127.0.0.1:8081"!==location.origin&&"localhost:8081"!==location.origin||(t=!0),t},t.getKeyList=function(t,e){if(!Array.isArray(t))return[];for(var r=[],n=0,o=t;n<o.length;n++){var i=o[n];i&&void 0!==i[e]&&null!==i[e]&&r.push(i[e])}return r},t.getQueryMap=function(t){if(!/^(?:(https?|ftp|rtsp|mms|ws|wss):\/\/)?/i.test(t))return console.error(t+"不符合超链接规范"),{};var e=t.indexOf("?");if(-1===e)return{};for(var r={},n=0,o=t.slice(e+1).split("&");n<o.length;n++){var i=o[n].split("="),a=i[0],u=i[1];a&&(r[a]=u||"")}return r},t.getQueryString=function(t,e){var r=new RegExp("&{1}"+e+"\\=[a-zA-Z0-9_-]+","g"),n=t.replace(/\?/g,"&").match(r)[0];return n.substr(n.indexOf("=")+1)},t.getQueryVariable=function(t){for(var e=window.location.search.substring(1).split("&"),r=0;r<e.length;r++){var n=e[r].split("=");if(n[0]===t)return n[1]}return!1},t.getSvgInfo=function(t){if("undefined"==typeof window||"undefined"==typeof DOMParser)return t;try{var e=(new DOMParser).parseFromString(t,"image/svg+xml").querySelector("svg");if(!e)return t;var r=e.getAttribute("viewBox");if(!r)throw new Error("Invalid SVG string: Missing viewBox attribute.");var n=r.split(" ");return{width:parseInt(n[2],10),height:parseInt(n[3],10),body:Array.from(e.querySelectorAll("path")).map((function(t){return t.outerHTML})).join(" ")}}catch(e){return console.error("解析 SVG 失败:",e),t}},t.getTicket=function(){return localStorage.getItem("jsapiTicket")},t.getToken=s,t.getWecomToken=function(){return localStorage.getItem("wecom_token")},t.handleFlatStr=function(t,e){void 0===t&&(t="state");var r=function(t,e){void 0===e&&(e="state");for(var r,n=t;"string"==typeof n;)try{r=n,n=decodeURIComponent(n),n=JSON.parse(n)}catch(t){n=r;break}for(;n&&"object"==typeof n&&e in n&&("string"==typeof n[e]||"object"==typeof n[e]);)if("string"==typeof(n=n[e]))try{n=decodeURIComponent(n),n=JSON.parse(n)}catch(t){break}return n}(e,t);return"object"==typeof r?JSON.stringify(r):String(r)},t.hasClass=Y,t.hexToRgb=W,t.hideTextAtIndex=function(t,e,r){void 0===r&&(r="*"),"number"==typeof t&&(t=t.toString()),Array.isArray(e)||(e=[e]);for(var n=t.split(""),o=0,i=e;o<i.length;o++){var a=i[o];if("object"!=typeof a||Array.isArray(a))"number"==typeof a&&Number.isInteger(a)&&a>=0&&a<n.length&&(n[a]=r);else{var u=a.start,s=a.end;u>=0&&u<s&&s<n.length&&n.fill(r,u,s+1)}}return n.join("")},t.http=function(t){var e=t.cacheType,r=t.currentMode,n=t.errorCb,o=t.getTokenCb;return t.tokenKey,E.interceptors.request.use((function(t){return v(void 0,void 0,void 0,(function(){var r,n;return g(this,(function(o){return r=s(e),n=a(),t.headers.Authorization=r,t.headers.token=r,t.headers.FrontType=u(n),[2,t]}))}))}),(function(t){return Promise.reject(t)})),E.interceptors.response.use((function(t){return v(void 0,void 0,void 0,(function(){var n,i,a;return g(this,(function(u){return n=t.data,i=n.code||t.status,n instanceof Blob||i===k.CODES.Success?[2,n]:i===k.CODES.UnAuthorized?("local"!==r&&"dev"!==r&&"development"!==r&&(c(e),o&&"function"==typeof o&&o()),[2,Promise.reject(new Error("token过期!"))]):(a=n.message||n.msg,[2,Promise.reject(new Error(a||"Error"))])}))}))}),(function(t){return v(void 0,void 0,void 0,(function(){return g(this,(function(e){return n&&"function"==typeof n&&n(t),[2,Promise.reject(t)]}))}))})),E},t.httpEnum=k,t.humpTurnDashed=function(t){return void 0===t&&(t=""),t.replace(/\B([A-Z])/g,"-$1").toLowerCase()},t.intersection=function(t,e){return Array.isArray(t)&&Array.isArray(e)?t.filter((function(t){return e.includes(t)})):[]},t.isAllEmpty=function(t){return null==t||("string"==typeof t?0===t.trim().length:Array.isArray(t)?0===t.length:"object"==typeof t&&0===Object.keys(t).length)},t.isEmail=function(t){return/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(t)},t.isEmpty=i,t.isExternal=function(t){return/^(https?:|mailto:|tel:)/.test(t)},t.isImage=function(t){return/^image\//i.test(t)},t.isIncludeAllChildren=function(t,e,r){if(!Array.isArray(t)||!Array.isArray(e))return!1;var n=r||function(t,e){return JSON.stringify(t)===JSON.stringify(e)};return e.every((function(e){return t.some((function(t){return n(t,e)}))}))},t.isMobile=function(t){return/^0?(13[0-9]|14[5-9]|15[012356789]|166|17[0-8]|18[0-9]|19[8-9])[0-9]{8}$/.test(t.toString())},t.isMobileSimple=function(t){return t=t.toString(),/^1/.test(t)&&11===t.length},t.isPhone=function(t){return/^[1](([3][0-9])|([4][0,1,4-9])|([5][0-3,5-9])|([6][2,5,6,7])|([7][0-8])|([8][0-9])|([9][0-3,5-9]))[0-9]{8}$/.test(t)},t.isQQ=function(t){return/^[1-9][0-9]{4,9}$/gim.test(String(t))},t.isTelephone=function(t){return/^0[1-9][0-9]{1,2}-[2-8][0-9]{6,7}$/.test(String(t))},t.isUrl=function(t){return new RegExp("^(?:(https?|ftp|rtsp|mms|ws|wss):\\/\\/)?(?:\\S+(?::\\S*)?@)?(?:(?:localhost)|(?:[1-9]\\d{0,2}(?:\\.\\d{1,3}){3})|(?:$[0-9a-fA-F:]+$)|(?:(?:[a-zA-Z0-9-_]+\\.)+[a-zA-Z]{2,63}))(?::\\d{1,5})?(?:[/?#]\\S*)?$","i").test(t)},t.lighten=function(t,e){var r=W(t).map((function(t){return Math.floor((255-t)*e+t)}));return G(r[0],r[1],r[2])},t.newDate=function(t){return t?new Date(l(t)):new Date},t.openLink=function(t,e){if(void 0===e&&(e="_blank"),"undefined"!=typeof window){var r=document.createElement("a");r.setAttribute("href",t),r.setAttribute("target",e),r.setAttribute("rel","noreferrer noopener"),r.setAttribute("id","external");var n=document.getElementById("external");n&&document.body.removeChild(n),document.body.appendChild(r),r.click(),r.remove()}},t.randomString=function(t){t=t||32;for(var e="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678",r=e.length,n="",o=0;o<t;o++)n+=e.charAt(Math.floor(Math.random()*r));return n},t.recordLogMiddleware=function(t){var e=this;return function(r,n){return v(e,void 0,void 0,(function(){return g(this,(function(e){switch(function(t,e){var r;return function(t){var e,r;return t&&"string"==typeof t.method&&"string"==typeof t.url&&t.headers&&(void 0!==t.routerPath||void 0!==t.routeOptions||"function"==typeof t.getValidationFunction||"IncomingMessage"===(null===(r=null===(e=t.raw)||void 0===e?void 0:e.constructor)||void 0===r?void 0:r.name))}(t)&&void 0!==(null==e?void 0:e.statusCode)?"fastify":t&&t.req&&"function"==typeof t.req.header&&"function"==typeof t.req.query&&void 0!==t.req.raw?"hono":t&&t.request&&t.response&&"function"==typeof t.throw?t.requestContext||(null===(r=t.app)||void 0===r?void 0:r.getApplicationContext)?"midway":"koa":"unknown"}(r,n)){case"hono":return[2,L(r,n,t)];case"fastify":return[2,$(r,n,t)];case"koa":case"midway":return[2,z(r,n,t)];default:return console.warn("[requestLoggerUnified] Unknown framework detected, falling back to Koa-style handling"),[2,z(r,n,t)]}return[2]}))}))}},t.recordLogMiddlewareFastify=function(t){var e=this;return function(r,n){return v(e,void 0,void 0,(function(){return g(this,(function(e){return[2,$(r,n,t)]}))}))}},t.recordLogMiddlewareHono=function(t){var e=this;return function(r,n){return v(e,void 0,void 0,(function(){return g(this,(function(e){return[2,L(r,n,t)]}))}))}},t.recordLogMiddlewareKoa=function(t){var e=this;return function(r,n){return v(e,void 0,void 0,(function(){return g(this,(function(e){return[2,z(r,n,t)]}))}))}},t.recordLogMiddlewareMidway=function(t){var e=this;return function(r,n){return v(e,void 0,void 0,(function(){return g(this,(function(e){return[2,z(r,n,t)]}))}))}},t.removeClass=function(t,e){if("undefined"!=typeof window&&t&&Y(t,e)){var r=new RegExp("(\\s|^)"+e+"(\\s|$)");t.className=t.className.replace(r," ").trim()}},t.removeTicket=function(){return localStorage.removeItem("jsapiTicket")},t.removeToken=c,t.rgbToHex=G,t.sendLog=U,t.setTicket=function(t){return localStorage.setItem("jsapiTicket",t)},t.subBefore=function(t,e){return t&&"string"==typeof e?t.substring(0,t.indexOf(e)):""},t.sum=function(t){return Array.isArray(t)&&t.length>0?t.reduce((function(t,e){return t+e}),0):0},t.toThousands=w,t.toggleClass=function(t,e,r){if("undefined"!=typeof window){var n=r||document.body,o=n.className;o=o.replace(e,"").trim(),n.className=t?(o+" "+e).trim():o}},t.trimVal=function(t){return t?t.replace(/^\s+|\s+$/g,""):t},t.uuid=function(t,e){var r,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),o=[];if(e=e||n.length,t)for(r=0;r<t;r++)o[r]=n[0|Math.random()*e];else{var i=void 0;for(o[8]=o[13]=o[18]=o[23]="-",o[14]="4",r=0;r<36;r++)o[r]||(i=0|16*Math.random(),o[r]=n[19==r?3&i|8:i])}return o.join("")},t.validateTwoDecimal=function(t){return!t||""===t||/^(\d+)(\.\d{1,2})?$/.test(t.toString())},Object.defineProperty(t,"__esModule",{value:!0})}));