@wener/utils 1.1.12 → 1.1.14

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 (114) hide show
  1. package/dist/LICENSE.txt +1 -135
  2. package/dist/cjs/globalThis-ee7c1669.js +2 -0
  3. package/dist/cjs/globalThis-ee7c1669.js.map +1 -0
  4. package/dist/cjs/index.cjs +2 -2
  5. package/dist/cjs/index.cjs.map +1 -1
  6. package/dist/cjs/server.cjs +1 -1
  7. package/dist/cjs/server.cjs.map +1 -1
  8. package/dist/esm/globalThis-000611c3.js +2 -0
  9. package/dist/esm/globalThis-000611c3.js.map +1 -0
  10. package/dist/esm/index.js +4 -4
  11. package/dist/esm/index.js.map +1 -1
  12. package/dist/esm/server.js +1 -1
  13. package/dist/esm/server.js.map +1 -1
  14. package/dist/system/globalThis-7bba6592.js +2 -0
  15. package/dist/system/globalThis-7bba6592.js.map +1 -0
  16. package/dist/system/index.js +4 -4
  17. package/dist/system/index.js.map +1 -1
  18. package/dist/system/server.js +1 -1
  19. package/dist/system/server.js.map +1 -1
  20. package/lib/asyncs/timeout.js +3 -1
  21. package/lib/asyncs/timeout.js.map +1 -1
  22. package/lib/browsers/copy.js.map +1 -1
  23. package/lib/browsers/download.js +3 -1
  24. package/lib/browsers/download.js.map +1 -1
  25. package/lib/browsers/loaders.js +6 -2
  26. package/lib/browsers/loaders.js.map +1 -1
  27. package/lib/crypto/getRandomValues.js +1 -0
  28. package/lib/crypto/getRandomValues.js.map +1 -1
  29. package/lib/crypto/randomUUID.js +2 -0
  30. package/lib/crypto/randomUUID.js.map +1 -1
  31. package/lib/i18n/createTranslate.js +2 -1
  32. package/lib/i18n/createTranslate.js.map +1 -1
  33. package/lib/index.js +1 -0
  34. package/lib/index.js.map +1 -1
  35. package/lib/io/ArrayBuffers.js +1 -0
  36. package/lib/io/ArrayBuffers.js.map +1 -1
  37. package/lib/io/isTransferable.js +2 -0
  38. package/lib/io/isTransferable.js.map +1 -1
  39. package/lib/isomorphics/getGlobalThis.js.map +1 -1
  40. package/lib/isomorphics/globalThis.js +6 -0
  41. package/lib/isomorphics/globalThis.js.map +1 -0
  42. package/lib/isomorphics/structuredClone.js +1 -0
  43. package/lib/isomorphics/structuredClone.js.map +1 -1
  44. package/lib/logging/createLogger.js +15 -5
  45. package/lib/logging/createLogger.js.map +1 -1
  46. package/lib/server.js +3 -1
  47. package/lib/server.js.map +1 -1
  48. package/lib/servers/createFetchWithProxy.js +13 -0
  49. package/lib/servers/createFetchWithProxy.js.map +1 -0
  50. package/lib/servers/{createProxyFetch.js → createFetchWithProxyByNodeFetch.js} +8 -3
  51. package/lib/servers/createFetchWithProxyByNodeFetch.js.map +1 -0
  52. package/lib/servers/createFetchWithProxyByUndici.js +28 -0
  53. package/lib/servers/createFetchWithProxyByUndici.js.map +1 -0
  54. package/lib/servers/polyfillCrypto.js +2 -0
  55. package/lib/servers/polyfillCrypto.js.map +1 -1
  56. package/lib/servers/polyfillJsDom.js +2 -0
  57. package/lib/servers/polyfillJsDom.js.map +1 -1
  58. package/package.json +20 -28
  59. package/src/asyncs/createLazyPromise.test.ts +21 -21
  60. package/src/asyncs/timeout.ts +1 -1
  61. package/src/browsers/copy.ts +1 -1
  62. package/src/browsers/download.ts +1 -1
  63. package/src/browsers/loaders.ts +2 -2
  64. package/src/crypto/getRandomValues.ts +1 -0
  65. package/src/crypto/hashing.test.ts +10 -12
  66. package/src/crypto/pem/__snapshots__/pem.test.ts.snap +18 -0
  67. package/src/crypto/pem/pem.test.ts +14 -17
  68. package/src/crypto/randomUUID.ts +2 -0
  69. package/src/crypto/ulid.test.ts +9 -9
  70. package/src/i18n/createTranslate.test.ts +76 -88
  71. package/src/i18n/createTranslate.ts +2 -1
  72. package/src/index.ts +1 -0
  73. package/src/io/ArrayBuffer.test-d.ts +4 -2
  74. package/src/io/ArrayBuffers.base64.test.ts +17 -17
  75. package/src/io/ArrayBuffers.test.ts +8 -8
  76. package/src/io/ArrayBuffers.ts +1 -0
  77. package/src/io/Buffer.test.ts +4 -4
  78. package/src/io/isBuffer.test.ts +4 -4
  79. package/src/io/isTransferable.test.ts +7 -6
  80. package/src/io/isTransferable.ts +2 -0
  81. package/src/isomorphics/getGlobalThis.ts +3 -1
  82. package/src/isomorphics/globalThis.ts +3 -0
  83. package/src/isomorphics/structuredClone.test.ts +4 -4
  84. package/src/isomorphics/structuredClone.ts +1 -0
  85. package/src/langs/deepEqual.test.ts +4 -4
  86. package/src/langs/langs.test.ts +3 -3
  87. package/src/libs/ms.test.ts +311 -0
  88. package/src/logging/createLogger.ts +5 -5
  89. package/src/logging/logger.test.ts +8 -8
  90. package/src/modules/parseModuleId.test.ts +3 -3
  91. package/src/objects/get.test-d.ts +30 -22
  92. package/src/objects/parseObjectPath.test.ts +3 -3
  93. package/src/objects/set.test.ts +98 -117
  94. package/src/server.ts +3 -1
  95. package/src/servers/createFetchWithLogger.ts +75 -0
  96. package/src/servers/createFetchWithProxy.ts +12 -0
  97. package/src/servers/{createProxyFetch.ts → createFetchWithProxyByNodeFetch.ts} +6 -2
  98. package/src/servers/createFetchWithProxyByUndici.ts +36 -0
  99. package/src/servers/polyfillBrowser.test.ts +9 -9
  100. package/src/servers/polyfillCrypto.ts +3 -1
  101. package/src/servers/polyfillJsDom.ts +1 -0
  102. package/src/servers/polyfillWebSocket.ts +1 -0
  103. package/src/strings/renderTemplate.test.ts +6 -9
  104. package/src/validations/parseTimestamp.test.ts +4 -4
  105. package/dist/cjs/index-da9513d6.js +0 -13
  106. package/dist/cjs/index-da9513d6.js.map +0 -1
  107. package/dist/esm/index-c696799a.js +0 -13
  108. package/dist/esm/index-c696799a.js.map +0 -1
  109. package/dist/system/index-2dfef0f3.js +0 -13
  110. package/dist/system/index-2dfef0f3.js.map +0 -1
  111. package/lib/servers/createProxyFetch.js.map +0 -1
  112. package/src/crypto/pem/pem.test.ts.md +0 -24
  113. package/src/crypto/pem/pem.test.ts.snap +0 -0
  114. package/src/objects/get.test.ts +0 -63
package/dist/LICENSE.txt CHANGED
@@ -1,135 +1 @@
1
- Name: https-proxy-agent
2
- Version: 5.0.1
3
- License: MIT
4
- Private: false
5
- Description: An HTTP(s) proxy `http.Agent` implementation for HTTPS
6
- Repository: git://github.com/TooTallNate/node-https-proxy-agent.git
7
- Author: Nathan Rajlich <nathan@tootallnate.net> (http://n8.io/)
8
-
9
- ---
10
-
11
- Name: debug
12
- Version: 4.3.4
13
- License: MIT
14
- Private: false
15
- Description: Lightweight debugging utility for Node.js and the browser
16
- Repository: git://github.com/debug-js/debug.git
17
- Author: Josh Junon <josh.junon@protonmail.com>
18
- Contributors:
19
- TJ Holowaychuk <tj@vision-media.ca>
20
- Nathan Rajlich <nathan@tootallnate.net> (http://n8.io)
21
- Andrew Rhyne <rhyneandrew@gmail.com>
22
- License Copyright:
23
- ===
24
-
25
- (The MIT License)
26
-
27
- Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
28
- Copyright (c) 2018-2021 Josh Junon
29
-
30
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software
31
- and associated documentation files (the 'Software'), to deal in the Software without restriction,
32
- including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
33
- and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
34
- subject to the following conditions:
35
-
36
- The above copyright notice and this permission notice shall be included in all copies or substantial
37
- portions of the Software.
38
-
39
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
40
- LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
41
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
42
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
43
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
44
-
45
-
46
-
47
- ---
48
-
49
- Name: ms
50
- Version: 2.1.2
51
- License: MIT
52
- Private: false
53
- Description: Tiny millisecond conversion utility
54
- Repository: undefined
55
- License Copyright:
56
- ===
57
-
58
- The MIT License (MIT)
59
-
60
- Copyright (c) 2016 Zeit, Inc.
61
-
62
- Permission is hereby granted, free of charge, to any person obtaining a copy
63
- of this software and associated documentation files (the "Software"), to deal
64
- in the Software without restriction, including without limitation the rights
65
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
66
- copies of the Software, and to permit persons to whom the Software is
67
- furnished to do so, subject to the following conditions:
68
-
69
- The above copyright notice and this permission notice shall be included in all
70
- copies or substantial portions of the Software.
71
-
72
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
73
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
74
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
75
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
76
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
77
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
78
- SOFTWARE.
79
-
80
-
81
- ---
82
-
83
- Name: has-flag
84
- Version: 3.0.0
85
- License: MIT
86
- Private: false
87
- Description: Check if argv has a specific flag
88
- Repository: undefined
89
- Author: Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
90
- License Copyright:
91
- ===
92
-
93
- MIT License
94
-
95
- Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
96
-
97
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
98
-
99
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
100
-
101
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
102
-
103
-
104
- ---
105
-
106
- Name: supports-color
107
- Version: 5.5.0
108
- License: MIT
109
- Private: false
110
- Description: Detect whether a terminal supports color
111
- Repository: undefined
112
- Author: Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
113
- License Copyright:
114
- ===
115
-
116
- MIT License
117
-
118
- Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
119
-
120
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
121
-
122
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
123
-
124
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
125
-
126
-
127
- ---
128
-
129
- Name: agent-base
130
- Version: 6.0.2
131
- License: MIT
132
- Private: false
133
- Description: Turn a function into an `http.Agent` instance
134
- Repository: git://github.com/TooTallNate/node-agent-base.git
135
- Author: Nathan Rajlich <nathan@tootallnate.net> (http://n8.io/)
1
+ No third parties dependencies
@@ -0,0 +1,2 @@
1
+ "use strict";const l=()=>{if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global `this`")},o=l();exports.getGlobalThis=l,exports.globalThis=o;
2
+ //# sourceMappingURL=globalThis-ee7c1669.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"globalThis-ee7c1669.js","sources":["../../src/isomorphics/getGlobalThis.ts","../../src/isomorphics/globalThis.ts"],"sourcesContent":["declare const global: typeof globalThis;\n\n/**\n * isomorphic globalThis\n *\n * globalThis supported by ff 65, Chrome 71, Node 12, babel\n *\n * non-standard globalThis supported for Alipay Miniprogram\n *\n * @see https://caniuse.com/#search=globalThis\n * @see https://v8.dev/features/globalthis\n */\nexport const getGlobalThis = (): typeof globalThis => {\n if (typeof globalThis !== 'undefined') return globalThis;\n if (typeof self !== 'undefined') return self;\n if (typeof window !== 'undefined') return window;\n if (typeof global !== 'undefined') return global as any;\n if (typeof this !== 'undefined') return this as any;\n throw new Error('Unable to locate global `this`');\n};\n","import { getGlobalThis } from './getGlobalThis';\n\nexport const globalThis = getGlobalThis();\n"],"names":["getGlobalThis","globalThis"],"mappings":"AAYO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAMA,EAAgB,CAAyB,CAAA,CAAA,CAAA,CACpD,GAAI,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,IAAa,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAC9C,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,KAAS,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,KACxC,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,OAAW,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAC1C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,OAAO,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,OAAO,CAE1C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,IAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgC,CAClD,CAAA,CCjBaC,EAAaD,CAAc,CAAA,CAAA;"}
@@ -1,4 +1,4 @@
1
- "use strict";var he=Object.create;var I=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var ge=Object.getOwnPropertyNames;var me=Object.getPrototypeOf,we=Object.prototype.hasOwnProperty;var be=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ge(t))!we.call(e,o)&&o!==r&&I(e,o,{get:()=>t[o],enumerable:!(n=pe(t,o))||n.enumerable});return e};var Ae=(e,t,r)=>(r=e!=null?he(me(e)):{},be(t||!e||!e.__esModule?I(r,"default",{value:e,enumerable:!0}):r,e));function ve(e,t=null,r=R){return Object.fromEntries(t===null?Object.entries(e).map(([n,o])=>[n,r(o)]):t.map(n=>[n,r(n)]))}function R(e){return Array.isArray(e)?e[0]:e}function $e(e){return Array.isArray(e)?e[e.length-1]:e}function Be(e){return Array.isArray(e)?e:e==null?[]:[e]}async function Ee(e){const t=[];for await(const r of e)t.push(r);return t}function T(e){if(typeof e!="string")return Array.isArray(e)?e:[e];const t=e.split(".");if(!e.includes("["))return t;const r=[];for(const n of t)if(!n.endsWith("]"))r.push(n);else{const o=n.split("[");for(let a of o)a.endsWith("]")&&(a=a.slice(0,-1)),r.push(a)}return r}function U(e,t,r){const n=T(t);let o=e;for(const a of n)o=o?o[a]:void 0;return o===void 0?r:o}function Oe(e,t,r,n=!0){const o=T(t);let a=0;const s=o.length;let i=e,c,l;for(;a<s&&(l=o[a++],!(l==="__proto__"||l==="constructor"||l==="prototype"));)i=i[l]=a===s?n?S(i[l],r):r:typeof(c=i[l])==typeof o?c:o[a]*0!==0||~(""+o[a]).indexOf(".")?{}:[]}function S(e,t){let r;if(typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t))for(r=0;r<t.length;r++)e[r]=S(e[r],t[r]);else for(r in t){if(r==="__proto__"||r==="constructor"||r==="prototype")break;e[r]=S(e[r],t[r])}return e}return t}function F(e){return e&&(e instanceof Promise||e.then&&e.catch)}function je(e){const t={resolve(n){throw new Error("pending resolve")},reject(n){throw new Error("pending reject")}},r=Object.assign(new Promise((n,o)=>{t.reject=o,t.resolve=n}),{resolve(n){t.resolve(n)},reject(n){t.resolve(n)}});if(e){const n=t.resolve;let o=!0;t.resolve=i=>{o=!1,n(i)};const a=r.then.bind(r);r.then=(...i)=>{if(o){o=!1;try{const c=e(t.resolve,t.reject);F(c)?c.then(t.resolve,t.reject):c!==void 0&&t.resolve(c)}catch(c){t.reject(c)}}return a(...i)};const s=t;return s.then=r.then,s.catch=r.catch.bind(r),r.finally&&(s.finally=r.finally),Object.defineProperty(s,Symbol.species,{get(){return Promise}}),s}return r}function xe(e,t,r=t){let n;const o=async()=>{await e(),n=setTimeout(o,t)};return n=setTimeout(o,r),()=>n}function Ce(e){clearTimeout(e==null?void 0:e())}const Te=e=>new Promise(t=>setTimeout(t,e));function Ue(e,t){const r=new z;let n;return Promise.race([e,new Promise((o,a)=>{n=setTimeout(()=>a(r),t)})]).then(o=>(clearTimeout(n),o),o=>{throw clearTimeout(n),o})}class z extends Error{constructor(){super("TimeoutError")}}function Se(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(let n=0;n<r.length;n++)if(!Object.prototype.hasOwnProperty.call(t,r[n])||!Object.is(e[r[n]],t[r[n]]))return!1;return!0}const q=Object.prototype.hasOwnProperty,Me=typeof Element<"u";function W(e,t,r){for(r of e.keys())if(A(r,t))return r}function A(e,t){let r,n,o;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((n=e.length)===t.length)for(;n--&&A(e[n],t[n]););return n===-1}if(r===Set){if(e.size!==t.size)return!1;for(n of e)if(o=n,o&&typeof o=="object"&&(o=W(t,o),!o)||!t.has(o))return!1;return!0}if(r===Map){if(e.size!==t.size)return!1;for(n of e)if(o=n[0],o&&typeof o=="object"&&(o=W(t,o),!o)||!A(n[1],t.get(o)))return!1;return!0}if(r===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(r===DataView){if((n=e.byteLength)===t.byteLength)for(;n--&&e.getInt8(n)===t.getInt8(n););return n===-1}if(ArrayBuffer.isView(e)){if((n=e.byteLength)===t.byteLength)for(;n--&&e[n]===t[n];);return n===-1}if(Me&&e instanceof Element)return!1;if(!r||typeof e=="object"){n=0;for(r in e)if(!((r==="_owner"||r==="__v"||r==="__o")&&e.$$typeof)&&(q.call(e,r)&&++n&&!q.call(t,r)||!(r in t)||!A(e[r],t[r])))return!1;return Object.keys(t).length===n}}return e!==e&&t!==t}function v(e){return Object.prototype.toString.call(e).slice(8,-1)}function Pe(e){return e&&(Array.isArray(e)?e.slice():typeof e=="object"?Object.assign({},e):e)}function ke(e){return typeof e=="function"&&/^class\s/.test(Function.prototype.toString.call(e))}function Le(e){return e!=null}function Z(e){return v(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function De(e){return Z(e)&&Object.keys(e).length===0}function Ve(e,t=!1){if(typeof e=="boolean")return e;if(typeof e=="string")switch(e.toLowerCase()){case"f":case"false":case"0":return!1;case"1":case"t":case"true":return!0}else if(typeof e=="number")switch(e){case 0:return!1;case 1:return!0}if(!t)return Boolean(e)}function _e(e,...t){return e instanceof Function?e(...t):e}function Ne(e,{resolver:t=(...r)=>JSON.stringify(r)}={}){if(typeof e!="function")throw new Error("`callback` should be a function");if(t!==void 0&&typeof t!="function")throw new Error("`resolver` should be a function");const r={},n=function(){const o=Array.prototype.slice.call(arguments),a=t.apply(this,o);return a in r||(r[a]=e.apply(this,o)),r[a]};return n.cache=r,n}function Ie(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function Re(e){if(e){if(e instanceof Date)return e;if(typeof e=="string"&&/^[0-9.]+$/.test(e)){let t=parseFloat(e);return Math.floor(t).toString().length<=11&&(t*=1e3),new Date(t)}else if(typeof e=="string"){const t=new Date(e);if(!isNaN(+t))return t}throw new Error(`parseTimestamp: invalid "${e}"`)}}const Fe=/^(?<n>(?:@(?<org>[a-z0-9-~][a-z0-9-._~]*)\/)?(?<pkg>[a-z0-9-~][a-z0-9-._~]*))(?:@(?<v>[-a-z0-9><=_.^~]+))?(?<p>\/[^\r\n]*)?$/;function ze(e){var t;const r=(t=e.match(Fe))==null?void 0:t.groups;if(!r)return;const{n,v:o,p:a,org:s,pkg:i}=r,c=Boolean(s),l=/^\d+\.\d+\.\d+/.test(o)?o:void 0,p=o||"latest",b={id:`${n}@${p}`,name:n,range:p,scoped:c,pkg:i,org:s,versioned:Boolean(o)};return l&&(b.version=l),a&&(b.path=a),b.scoped||delete b.org,b}function qe(e){return e&&e[Symbol.toStringTag]==="Module"}function M(e=({level:r,values:n,...o})=>{var a;({values:n,...o}=We(o,n)),(a=console[r])==null||a.call(console,...n,o)},t={}){return{trace:(...r)=>e({...t,level:"trace",values:r}),debug:(...r)=>e({...t,level:"debug",values:r}),info:(...r)=>e({...t,level:"info",values:r}),warn:(...r)=>e({...t,level:"warn",values:r}),error:(...r)=>e({...t,level:"error",values:r}),child:r=>M(e,{...t,...r})}}function We(e,t){return t[0]&&typeof t[0]=="object"?{...e,...t[0],values:t.slice(1)}:{...e,values:t}}function G(){const e=(...t)=>{};return{trace:e,debug:e,info:e,warn:e,error:e,child:()=>G()}}function Ze(e,t){return e.child?e.child(t):M(r=>{const{level:n,values:o,...a}=r;Object.keys(a).length?e[n](a,...o):e[n](...o)},t)}function Ge(e){let t=!1,r=!1,n=!1;for(let o=0;o<e.length;o++){const a=e[o];t&&/[a-zA-Z]/.test(a)&&a.toUpperCase()===a?(e=e.slice(0,o)+"-"+e.slice(o),t=!1,n=r,r=!0,o++):r&&n&&/[a-zA-Z]/.test(a)&&a.toLowerCase()===a?(e=e.slice(0,o-1)+"-"+e.slice(o-1),n=r,r=!1,t=!0):(t=a.toLowerCase()===a&&a.toUpperCase()!==a,n=r,r=a.toUpperCase()===a&&a.toLowerCase()!==a)}return e}function He(e){return H(e,{pascalCase:!0})}function H(e,t={pascalCase:!1}){if(!(typeof e=="string"||Array.isArray(e)))throw new TypeError("Expected the input to be `string | string[]`");const r=n=>t.pascalCase?n.charAt(0).toUpperCase()+n.slice(1):n;return Array.isArray(e)?e=e.map(n=>n.trim()).filter(n=>n.length).join("-"):e=e.trim(),e.length===0?"":e.length===1?t.pascalCase?e.toUpperCase():e.toLowerCase():(e!==e.toLowerCase()&&(e=Ge(e)),e=e.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,(n,o)=>o.toUpperCase()).replace(/\d+(\w|$)/g,n=>n.toUpperCase()),r(e))}function J(e,t,r="js"){let n;return t?typeof t=="function"?n=t:n=o=>U(t,o):n=()=>"",typeof r=="string"&&(r=K[r]||K.js),e.replace(r,(o,a)=>n(a.trim()))}const K={js:/\${(.*?)}/g,common:/{{(.*?)}}/g};function Je(e,t=!1,r=1){const n=t?1e3:1024;if(Math.abs(e)<n)return`${e} B`;const o=t?["kB","MB","GB","TB","PB","EB","ZB","YB"]:["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let a=-1;const s=10**r;do e/=n,++a;while(Math.round(Math.abs(e)*s)/s>=n&&a<o.length-1);return e.toFixed(r)+" "+o[a]}function Ke(e){let t="";const r=e||{},n=o=>{if(Array.isArray(o))return o;const a=o.split(/[_-]/);return a.length>1?[o,a[0]]:[o]};return{locale(o){return t=o||t},dict:(o,a)=>{if(a){r[o]=Object.assign(r[o]||{},a);return}return r[o]},t(o,a,s){let i;for(const c of n(s||t))if(i=U(r[c],o,""),i)break;return typeof i=="function"?i(a):typeof i=="string"?J(i,a,"common"):i}}}function $(e){var t,r;return(r=(t=e==null?void 0:e.constructor)==null?void 0:t.isBuffer)==null?void 0:r.call(t,e)}function Ye(e){return Y||=Qe(),Y.some(t=>e instanceof t)}let Y;function Qe(){const e=globalThis.window||globalThis||global;return[e.ArrayBuffer,e.MessagePort,e.ReadableStream,e.WritableStream,e.TransformStream,e.AudioData,e.ImageBitmap,e.VideoFrame,e.OffscreenCanvas,e.RTCDataChannel].filter(Boolean)}const g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",B=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<g.length;e++)B[g.charCodeAt(e)]=e;function Xe(e){const t=new Uint8Array(e),r=t.length;let n="";for(let o=0;o<r;o+=3)n+=g[t[o]>>2],n+=g[(t[o]&3)<<4|t[o+1]>>4],n+=g[(t[o+1]&15)<<2|t[o+2]>>6],n+=g[t[o+2]&63];return r%3===2?n=n.substring(0,n.length-1)+"=":r%3===1&&(n=n.substring(0,n.length-2)+"=="),n}function et(e){const t=e.length;let r=e.length*.75,n,o=0,a,s,i,c;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);const l=new ArrayBuffer(r),p=new Uint8Array(l);for(n=0;n<t;n+=4)a=B[e.charCodeAt(n)],s=B[e.charCodeAt(n+1)],i=B[e.charCodeAt(n+2)],c=B[e.charCodeAt(n+3)],p[o++]=a<<2|s>>4,p[o++]=(s&15)<<4|i>>2,p[o++]=(i&3)<<6|c&63;return l}var Q=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},P=(e,t,r)=>(Q(e,t,"read from private field"),r?r.call(e):t.get(e)),X=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},ee=(e,t,r,n)=>(Q(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),j,E;const f=class{static isNativeBufferAvailable(){var t,r;return P(this,E)??ee(this,E,!((r=(t=globalThis.Buffer)==null?void 0:t.isPollyfill)!=null&&r.call(t)))}static isNativeBufferAllowed(){return P(this,j)&&P(this,E)}static setNativeBufferAllowed(t){ee(this,j,t)}};let u=f;j=new WeakMap,E=new WeakMap,X(u,j,!0),X(u,E,void 0),u.isArrayBuffer=e=>e instanceof ArrayBuffer,u.slice=(e,t,r)=>$(e)?Uint8Array.prototype.slice.call(e,t,r):e.slice(t,r),u.asView=(e,t,r,n)=>t instanceof e&&(r??0)===0&&n===void 0?t:ArrayBuffer.isView(t)||$(t)?f.isNativeBufferAllowed()&&e===Buffer?Buffer.from(t.buffer,r,n):new e(t.buffer,t.byteOffset+(r??0),n??t.byteLength):new e(t,r,n),u.toString=(e,t="utf8")=>{if(typeof e=="string")switch(t){case"base64":return btoa(e);case"utf-8":case"utf8":return e;default:throw new Error(`[ArrayBuffers.toString] Unsupported encoding for string: ${t}`)}if(f.isNativeBufferAllowed())return Buffer.from(f.asView(Uint8Array,e)).toString(t);switch(t){case"hex":return[...f.asView(Uint8Array,e)].map(r=>tt[r]).join("");case"base64":return Xe(f.asView(Uint8Array,e));case"utf8":case"utf-8":return new TextDecoder().decode(e);case"ascii":{const r=f.asView(Uint8Array,e);return String.fromCharCode(...r.map(n=>n&127))}case"latin1":case"binary":{const r=f.asView(Uint8Array,e);return String.fromCharCode(...r)}case"ucs2":case"ucs-2":case"utf16le":{const r=f.asView(Uint8Array,e);let n="";for(let o=0;o<r.length-1;o+=2)n+=String.fromCharCode(r[o]+r[o+1]*256);return n}default:throw new Error(`[ArrayBuffers.toString] Unknown encoding: ${t}`)}},u.toJSON=(e,t)=>JSON.parse(f.toString(e),t),u.alloc=(e,t,r)=>t!==void 0?typeof t=="number"?new Uint8Array(e).fill(t):f.asView(Uint8Array,f.from(t,r)).slice(0,e):new ArrayBuffer(e),u.from=(e,t="utf8")=>{if(!e)return new ArrayBuffer(0);if(typeof e=="string"){if(f.isNativeBufferAllowed())return Buffer.from(e,t);switch(t){case"utf-8":case"utf8":return new TextEncoder().encode(e).buffer;case"base64":return et(e.replace(/[^0-9a-zA-Z=+/_]/g,""));default:throw new Error(`[ArrayBuffers.from] Unknown encoding: ${t}`)}}if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e)||$(e)){if(e.byteOffset!==0)throw new Error("ArrayBuffers.from do not support view with offset");return e.buffer}if(Array.isArray(e))return new Uint8Array(e);const r=v(e);throw new TypeError(`ArrayBuffers.from unsupported type ${r}`)},u.isEncoding=e=>{switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":return!0;default:return!1}},u.concat=(e,t,r=0)=>{const n=e.reduce((a,s)=>a+s.byteLength,0),o=t?new Uint8Array(t):new Uint8Array(n);for(const a of e){if(!(a!=null&&a.byteLength))continue;let s;if(a instanceof ArrayBuffer)s=new Uint8Array(a);else if(ArrayBuffer.isView(a))s=new Uint8Array(a.buffer,a.byteOffset,a.byteLength);else throw new Error(`ArrayBuffers.concat unsupported type ${v(a)}`);o.set(s,r),r+=a.byteLength}return o.buffer};const tt=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=r*16;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}(),k=class extends Uint8Array{static get isPolyfill(){return!0}static isBuffer(e){return e instanceof k||$(e)}static from(e,t){return new k(u.from(e,t))}toString(e){return u.toString(this,e)}};let te=k;te.isEncoding=u.isEncoding;let L;function rt(){let e;function t(){return navigator.userAgent.match(/ipad|iphone/i)}function r(a){e=document.createElement("textArea"),e.value=a,document.body.appendChild(e)}function n(){let a,s;if(t()){if(a=document.createRange(),a.selectNodeContents(e),s=window.getSelection(),s===null){console.error("no selection");return}s.removeAllRanges(),s.addRange(a),e.setSelectionRange(0,999999)}else e.select()}function o(){document.execCommand("copy"),document.body.removeChild(e)}L=a=>{r(a),n(),o()}}function nt(e){var t,r;return(r=(t=window.navigator)==null?void 0:t.clipboard)!=null&&r.writeText?window.navigator.clipboard.writeText(e):(L||rt(),L(e))}function ot(e,t,{type:r="application/octet-stream",raw:n=!1}={}){const o=document.createElement("a");let a=()=>null;try{if(o.download=e,typeof t=="string"&&/^(https?:|data:)/.test(t)&&!n?o.href=t:typeof t=="string"&&(t=new TextEncoder().encode(t)),t instanceof Uint8Array&&(t=new Blob([t],{type:r})),t instanceof File||t instanceof Blob||t instanceof MediaSource)o.href=URL.createObjectURL(t),a=()=>URL.revokeObjectURL(o.href);else throw console.error("invalid download data",t),new Error(`can not download ${Object.getPrototypeOf(t)}`);o.click()}finally{a()}}function re(e,t,r,n){e.onload=()=>t(e),e.onerror=a=>{e.remove(),r(a)};const{attributes:o={}}=n||{};Object.entries(o).forEach(([a,s])=>e.setAttribute(a,s)),document.head.appendChild(e)}function ne(e,t){if(Array.isArray(e))return Promise.resolve().then(async()=>{const n=[];for(const o of e)n.push(await ne(o));return n});const r=document.querySelector(`script[src="${e}"]`);return r?Promise.resolve(r):new Promise((n,o)=>{const a=document.createElement("script");a.src=e,re(a,n,o,t)})}function at(e,t){const r=document.querySelector(`link[href="${e}"]`);return r?Promise.resolve(r):new Promise((n,o)=>{const a=document.createElement("link");a.rel="stylesheet",a.href=e,re(a,n,o,t)})}function st(e){var t;if(!e)return{};const r=e.items??[];if(r.length>=2&&r[0].kind==="string"&&r[1].kind==="file"){const n=e.getData("text"),o=r[1].getAsFile()??((t=e.files)==null?void 0:t.item(0));return o?{file:o,name:n}:(console.error(`no file ${n}`,r[1]),{})}else if(r[0].kind==="file"){const n=r[0].getAsFile();return n?{file:n,name:n.name}:(console.error("no file",r[0]),{})}else console.debug("file item not match",Array.from(r).map(n=>({type:n.type,kind:n.kind})));return{}}const it=()=>{if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global `this`")},ct=globalThis.structuredClone||m;function oe(e,t,r){typeof r.value=="object"&&(r.value=m(r.value)),!r.enumerable||r.get||r.set||!r.configurable||!r.writable||t==="__proto__"?Object.defineProperty(e,t,r):e[t]=r.value}function m(e){if(typeof e!="object")return e;let t=0,r,n,o;const a=v(e);switch(a){case"Array":o=Array(e.length);break;case"Object":o=Object.create(e.__proto__||null);break;case"Set":o=new Set,e.forEach(function(s){o.add(m(s))});break;case"Map":o=new Map,e.forEach(function(s,i){o.set(m(i),m(s))});break;case"Date":o=new Date(+e);break;case"RegExp":o=new RegExp(e.source,e.flags);break;case"DataView":o=new e.constructor(m(e.buffer));break;case"ArrayBuffer":o=e.slice(0);break;default:a.endsWith("Array")&&(o=new e.constructor(e))}if(o){for(n=Object.getOwnPropertySymbols(e);t<n.length;t++)oe(o,n[t],Object.getOwnPropertyDescriptor(e,n[t]));for(t=0,n=Object.getOwnPropertyNames(e);t<n.length;t++)Object.hasOwnProperty.call(o,r=n[t])&&o[r]===e[r]||oe(o,r,Object.getOwnPropertyDescriptor(e,r))}return o||e}var ae,se;const lt=((se=(ae=globalThis.crypto)==null?void 0:ae.randomUUID)==null?void 0:se.bind(globalThis.crypto))||ut;function ut(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}let D;if(typeof window>"u")try{typeof require>"u"?import("crypto").then(e=>D=e.default):D=require("crypto")}catch{}function ft(){return D}var ie,ce,le,ue;exports.getRandomValues=((ce=(ie=globalThis.crypto)==null?void 0:ie.getRandomValues)==null?void 0:ce.bind(globalThis.crypto))||((ue=(le=globalThis.msCrypto)==null?void 0:le.getRandomValues)==null?void 0:ue.bind(globalThis.msCrypto))||dt;function dt(e){var t,r,n;const o=ft();if((t=o==null?void 0:o.webcrypto)!=null&&t.getRandomValues)return exports.getRandomValues=(n=(r=o==null?void 0:o.webcrypto)==null?void 0:r.getRandomValues)==null?void 0:n.bind(o==null?void 0:o.webcrypto),o.webcrypto.getRandomValues(e);if(o!=null&&o.randomBytes){if(!(e instanceof Uint8Array))throw new TypeError("expected Uint8Array");if(e.length>65536){const s=new Error;throw s.code=22,s.message=`Failed to execute 'getRandomValues' on 'Crypto': The ArrayBufferView's byte length (${e.length}) exceeds the number of bytes of entropy available via this API (65536).`,s.name="QuotaExceededError",s}const a=o.randomBytes(e.length);return e.set(a),e}throw new Error("[getRandomValues]: No secure random number generator available.")}function yt(e){return x("SHA-1",e)}function ht(e){return x("SHA-256",e)}function pt(e){return x("SHA-384",e)}function gt(e){return x("SHA-512",e)}function x(e,t){return crypto.subtle.digest(e,mt(t))}function mt(e){return typeof e=="string"?new TextEncoder().encode(e):e}function wt(e){return Array.from(new Uint8Array(e)).map(t=>t.toString(16).padStart(2,"0")).join("")}function d(e){const t=new Error(e);return t.source="ulid",t}const y="0123456789ABCDEFGHJKMNPQRSTVWXYZ",h=y.length,V=Math.pow(2,48)-1,w=10,_=16;function bt(e){return(e==null?void 0:e.length)===26&&/^[0-9A-HJKMNP-TV-Z]{26}$/i.test(e)}function fe(e,t,r){return t>e.length-1?e:e.substr(0,t)+r+e.substr(t+1)}function At(e){let t,r=e.length,n,o;const a=h-1;for(;!t&&r-->=0;){if(n=e[r],o=y.indexOf(n),o===-1)throw d("incorrectly encoded string");if(o===a){e=fe(e,r,y[0]);continue}t=fe(e,r,y[o+1])}if(typeof t=="string")return t;throw d("cannot increment this string")}function vt(e){let t=Math.floor(e()*h);return t===h&&(t=h-1),y.charAt(t)}function N(e,t){if(isNaN(e))throw new Error(`${e} must be a number`);if(e>V)throw d(`cannot encode time greater than ${V}`);if(e<0)throw d("time must be positive");if(!Number.isInteger(e))throw d("time must be an integer");let r,n="";for(;t>0;t--)r=e%h,n=y.charAt(r)+n,e=(e-r)/h;return n}function de(e,t){let r="";for(;e>0;e--)r=vt(t)+r;return r}function $t(e){if(e.length!==w+_)throw d("malformed ulid");const t=e.substr(0,w).split("").reverse().reduce((r,n,o)=>{const a=y.indexOf(n);if(a===-1)throw d("invalid character found: "+n);return r+=a*Math.pow(h,o)},0);if(t>V)throw d("malformed ulid, timestamp too large");return{timestamp:t,random:e.substring(w)}}function Bt(){return()=>{const e=new Uint8Array(1);return exports.getRandomValues(e),e[0]/255}}function ye({monotonic:e=!0,random:t=Bt(),now:r=Date.now}={}){if(!e)return function(a){return a||=r(),N(a,w)+de(_,t)};let n=0,o;return function(a){if(a||=r(),a<=n&&o){const i=o=At(o);return N(n,w)+i}n=a;const s=o=de(_,t);return N(a,w)+s}}exports.ulid=(...e)=>O?O(...e):(O=ye(),exports.ulid=O,O(...e));let O;class Et{static decode(t){const r=t.match(/^-----BEGIN (?<type>[^\r\n-]+)-----$\r?\n(?<headers>(^[^:\r\n]+:[^\n\r]+\r?\n)+\r?\n)?(?<data>[a-zA-Z0-9/_=\n\r+]+?)^-----END \1-----$\r?\n?/ms);if(!(r!=null&&r.groups))throw new Error("Invalid PEM data");const{type:n,headers:o="",data:a}=r.groups,s=o.split(`
1
+ "use strict";var pe=Object.create;var R=Object.defineProperty;var ge=Object.getOwnPropertyDescriptor;var me=Object.getOwnPropertyNames;var we=Object.getPrototypeOf,be=Object.prototype.hasOwnProperty;var Ae=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of me(t))!be.call(e,o)&&o!==r&&R(e,o,{get:()=>t[o],enumerable:!(n=ge(t,o))||n.enumerable});return e};var ve=(e,t,r)=>(r=e!=null?pe(we(e)):{},Ae(t||!e||!e.__esModule?R(r,"default",{value:e,enumerable:!0}):r,e));var d=require("./globalThis-ee7c1669.js");function $e(e,t=null,r=F){return Object.fromEntries(t===null?Object.entries(e).map(([n,o])=>[n,r(o)]):t.map(n=>[n,r(n)]))}function F(e){return Array.isArray(e)?e[0]:e}function Be(e){return Array.isArray(e)?e[e.length-1]:e}function Oe(e){return Array.isArray(e)?e:e==null?[]:[e]}async function je(e){const t=[];for await(const r of e)t.push(r);return t}function U(e){if(typeof e!="string")return Array.isArray(e)?e:[e];const t=e.split(".");if(!e.includes("["))return t;const r=[];for(const n of t)if(!n.endsWith("]"))r.push(n);else{const o=n.split("[");for(let a of o)a.endsWith("]")&&(a=a.slice(0,-1)),r.push(a)}return r}function S(e,t,r){const n=U(t);let o=e;for(const a of n)o=o?o[a]:void 0;return o===void 0?r:o}function Ee(e,t,r,n=!0){const o=U(t);let a=0;const s=o.length;let i=e,c,l;for(;a<s&&(l=o[a++],!(l==="__proto__"||l==="constructor"||l==="prototype"));)i=i[l]=a===s?n?M(i[l],r):r:typeof(c=i[l])==typeof o?c:o[a]*0!==0||~(""+o[a]).indexOf(".")?{}:[]}function M(e,t){let r;if(typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t))for(r=0;r<t.length;r++)e[r]=M(e[r],t[r]);else for(r in t){if(r==="__proto__"||r==="constructor"||r==="prototype")break;e[r]=M(e[r],t[r])}return e}return t}function z(e){return e&&(e instanceof Promise||e.then&&e.catch)}function xe(e){const t={resolve(n){throw new Error("pending resolve")},reject(n){throw new Error("pending reject")}},r=Object.assign(new Promise((n,o)=>{t.reject=o,t.resolve=n}),{resolve(n){t.resolve(n)},reject(n){t.resolve(n)}});if(e){const n=t.resolve;let o=!0;t.resolve=i=>{o=!1,n(i)};const a=r.then.bind(r);r.then=(...i)=>{if(o){o=!1;try{const c=e(t.resolve,t.reject);z(c)?c.then(t.resolve,t.reject):c!==void 0&&t.resolve(c)}catch(c){t.reject(c)}}return a(...i)};const s=t;return s.then=r.then,s.catch=r.catch.bind(r),r.finally&&(s.finally=r.finally),Object.defineProperty(s,Symbol.species,{get(){return Promise}}),s}return r}function Ce(e,t,r=t){let n;const o=async()=>{await e(),n=setTimeout(o,t)};return n=setTimeout(o,r),()=>n}function Te(e){clearTimeout(e==null?void 0:e())}const Ue=e=>new Promise(t=>setTimeout(t,e));function Se(e,t){const r=new q;let n;return Promise.race([e,new Promise((o,a)=>{n=setTimeout(()=>{a(r)},t)})]).then(o=>(clearTimeout(n),o),o=>{throw clearTimeout(n),o})}class q extends Error{constructor(){super("TimeoutError")}}function Me(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(let n=0;n<r.length;n++)if(!Object.prototype.hasOwnProperty.call(t,r[n])||!Object.is(e[r[n]],t[r[n]]))return!1;return!0}const W=Object.prototype.hasOwnProperty,Pe=typeof Element<"u";function Z(e,t,r){for(r of e.keys())if(v(r,t))return r}function v(e,t){let r,n,o;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((n=e.length)===t.length)for(;n--&&v(e[n],t[n]););return n===-1}if(r===Set){if(e.size!==t.size)return!1;for(n of e)if(o=n,o&&typeof o=="object"&&(o=Z(t,o),!o)||!t.has(o))return!1;return!0}if(r===Map){if(e.size!==t.size)return!1;for(n of e)if(o=n[0],o&&typeof o=="object"&&(o=Z(t,o),!o)||!v(n[1],t.get(o)))return!1;return!0}if(r===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(r===DataView){if((n=e.byteLength)===t.byteLength)for(;n--&&e.getInt8(n)===t.getInt8(n););return n===-1}if(ArrayBuffer.isView(e)){if((n=e.byteLength)===t.byteLength)for(;n--&&e[n]===t[n];);return n===-1}if(Pe&&e instanceof Element)return!1;if(!r||typeof e=="object"){n=0;for(r in e)if(!((r==="_owner"||r==="__v"||r==="__o")&&e.$$typeof)&&(W.call(e,r)&&++n&&!W.call(t,r)||!(r in t)||!v(e[r],t[r])))return!1;return Object.keys(t).length===n}}return e!==e&&t!==t}function $(e){return Object.prototype.toString.call(e).slice(8,-1)}function ke(e){return e&&(Array.isArray(e)?e.slice():typeof e=="object"?Object.assign({},e):e)}function Le(e){return typeof e=="function"&&/^class\s/.test(Function.prototype.toString.call(e))}function De(e){return e!=null}function G(e){return $(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function Ve(e){return G(e)&&Object.keys(e).length===0}function _e(e,t=!1){if(typeof e=="boolean")return e;if(typeof e=="string")switch(e.toLowerCase()){case"f":case"false":case"0":return!1;case"1":case"t":case"true":return!0}else if(typeof e=="number")switch(e){case 0:return!1;case 1:return!0}if(!t)return!!e}function Ne(e,...t){return e instanceof Function?e(...t):e}function Ie(e,{resolver:t=(...r)=>JSON.stringify(r)}={}){if(typeof e!="function")throw new Error("`callback` should be a function");if(t!==void 0&&typeof t!="function")throw new Error("`resolver` should be a function");const r={},n=function(){const o=Array.prototype.slice.call(arguments),a=t.apply(this,o);return a in r||(r[a]=e.apply(this,o)),r[a]};return n.cache=r,n}function Re(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function Fe(e){if(e){if(e instanceof Date)return e;if(typeof e=="string"&&/^[0-9.]+$/.test(e)){let t=parseFloat(e);return Math.floor(t).toString().length<=11&&(t*=1e3),new Date(t)}else if(typeof e=="string"){const t=new Date(e);if(!isNaN(+t))return t}throw new Error(`parseTimestamp: invalid "${e}"`)}}const ze=/^(?<n>(?:@(?<org>[a-z0-9-~][a-z0-9-._~]*)\/)?(?<pkg>[a-z0-9-~][a-z0-9-._~]*))(?:@(?<v>[-a-z0-9><=_.^~]+))?(?<p>\/[^\r\n]*)?$/;function qe(e){var t;const r=(t=e.match(ze))==null?void 0:t.groups;if(!r)return;const{n,v:o,p:a,org:s,pkg:i}=r,c=!!s,l=/^\d+\.\d+\.\d+/.test(o)?o:void 0,g=o||"latest",A={id:`${n}@${g}`,name:n,range:g,scoped:c,pkg:i,org:s,versioned:!!o};return l&&(A.version=l),a&&(A.path=a),A.scoped||delete A.org,A}function We(e){return e&&e[Symbol.toStringTag]==="Module"}function P(e=({level:r,values:n,...o})=>{var a;({values:n,...o}=Ze(o,n)),(a=console[r])==null||a.call(console,...n,o)},t={}){return{trace:(...r)=>{e({...t,level:"trace",values:r})},debug:(...r)=>{e({...t,level:"debug",values:r})},info:(...r)=>{e({...t,level:"info",values:r})},warn:(...r)=>{e({...t,level:"warn",values:r})},error:(...r)=>{e({...t,level:"error",values:r})},child:r=>P(e,{...t,...r})}}function Ze(e,t){return t[0]&&typeof t[0]=="object"?{...e,...t[0],values:t.slice(1)}:{...e,values:t}}function H(){const e=(...t)=>{};return{trace:e,debug:e,info:e,warn:e,error:e,child:()=>H()}}function Ge(e,t){return e.child?e.child(t):P(r=>{const{level:n,values:o,...a}=r;Object.keys(a).length?e[n](a,...o):e[n](...o)},t)}function He(e){let t=!1,r=!1,n=!1;for(let o=0;o<e.length;o++){const a=e[o];t&&/[a-zA-Z]/.test(a)&&a.toUpperCase()===a?(e=e.slice(0,o)+"-"+e.slice(o),t=!1,n=r,r=!0,o++):r&&n&&/[a-zA-Z]/.test(a)&&a.toLowerCase()===a?(e=e.slice(0,o-1)+"-"+e.slice(o-1),n=r,r=!1,t=!0):(t=a.toLowerCase()===a&&a.toUpperCase()!==a,n=r,r=a.toUpperCase()===a&&a.toLowerCase()!==a)}return e}function Je(e){return J(e,{pascalCase:!0})}function J(e,t={pascalCase:!1}){if(!(typeof e=="string"||Array.isArray(e)))throw new TypeError("Expected the input to be `string | string[]`");const r=n=>t.pascalCase?n.charAt(0).toUpperCase()+n.slice(1):n;return Array.isArray(e)?e=e.map(n=>n.trim()).filter(n=>n.length).join("-"):e=e.trim(),e.length===0?"":e.length===1?t.pascalCase?e.toUpperCase():e.toLowerCase():(e!==e.toLowerCase()&&(e=He(e)),e=e.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,(n,o)=>o.toUpperCase()).replace(/\d+(\w|$)/g,n=>n.toUpperCase()),r(e))}function K(e,t,r="js"){let n;return t?typeof t=="function"?n=t:n=o=>S(t,o):n=()=>"",typeof r=="string"&&(r=Y[r]||Y.js),e.replace(r,(o,a)=>n(a.trim()))}const Y={js:/\${(.*?)}/g,common:/{{(.*?)}}/g};function Ke(e,t=!1,r=1){const n=t?1e3:1024;if(Math.abs(e)<n)return`${e} B`;const o=t?["kB","MB","GB","TB","PB","EB","ZB","YB"]:["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let a=-1;const s=10**r;do e/=n,++a;while(Math.round(Math.abs(e)*s)/s>=n&&a<o.length-1);return e.toFixed(r)+" "+o[a]}function Ye(e){let t="";const r=e||{},n=o=>{if(Array.isArray(o))return o;const a=o.split(/[_-]/);return a.length>1?[o,a[0]]:[o]};return{locale(o){return t=o||t},dict:(o,a)=>{if(a){r[o]=Object.assign(r[o]||{},a);return}return r[o]},t(o,a,s){let i;for(const c of n(s||t))if(i=S(r[c],o,""),i)break;return typeof i=="function"?i(a):typeof i=="string"?K(i,a,"common"):i}}}function B(e){var t,r;return(r=(t=e==null?void 0:e.constructor)==null?void 0:t.isBuffer)==null?void 0:r.call(t,e)}function Qe(e){return Q||=Xe(),Q.some(t=>e instanceof t)}let Q;function Xe(){const e=d.globalThis.window||d.globalThis||global;return[e.ArrayBuffer,e.MessagePort,e.ReadableStream,e.WritableStream,e.TransformStream,e.AudioData,e.ImageBitmap,e.VideoFrame,e.OffscreenCanvas,e.RTCDataChannel].filter(Boolean)}const m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",O=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<m.length;e++)O[m.charCodeAt(e)]=e;function et(e){const t=new Uint8Array(e),r=t.length;let n="";for(let o=0;o<r;o+=3)n+=m[t[o]>>2],n+=m[(t[o]&3)<<4|t[o+1]>>4],n+=m[(t[o+1]&15)<<2|t[o+2]>>6],n+=m[t[o+2]&63];return r%3===2?n=n.substring(0,n.length-1)+"=":r%3===1&&(n=n.substring(0,n.length-2)+"=="),n}function tt(e){const t=e.length;let r=e.length*.75,n,o=0,a,s,i,c;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);const l=new ArrayBuffer(r),g=new Uint8Array(l);for(n=0;n<t;n+=4)a=O[e.charCodeAt(n)],s=O[e.charCodeAt(n+1)],i=O[e.charCodeAt(n+2)],c=O[e.charCodeAt(n+3)],g[o++]=a<<2|s>>4,g[o++]=(s&15)<<4|i>>2,g[o++]=(i&3)<<6|c&63;return l}var X=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},k=(e,t,r)=>(X(e,t,"read from private field"),r?r.call(e):t.get(e)),ee=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},te=(e,t,r,n)=>(X(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),x,j;const f=class{static isNativeBufferAvailable(){var t,r;return k(this,j)??te(this,j,!((r=(t=d.globalThis.Buffer)==null?void 0:t.isPollyfill)!=null&&r.call(t)))}static isNativeBufferAllowed(){return k(this,x)&&k(this,j)}static setNativeBufferAllowed(t){te(this,x,t)}};let u=f;x=new WeakMap,j=new WeakMap,ee(u,x,!0),ee(u,j,void 0),u.isArrayBuffer=e=>e instanceof ArrayBuffer,u.slice=(e,t,r)=>B(e)?Uint8Array.prototype.slice.call(e,t,r):e.slice(t,r),u.asView=(e,t,r,n)=>t instanceof e&&(r??0)===0&&n===void 0?t:ArrayBuffer.isView(t)||B(t)?f.isNativeBufferAllowed()&&e===Buffer?Buffer.from(t.buffer,r,n):new e(t.buffer,t.byteOffset+(r??0),n??t.byteLength):new e(t,r,n),u.toString=(e,t="utf8")=>{if(typeof e=="string")switch(t){case"base64":return btoa(e);case"utf-8":case"utf8":return e;default:throw new Error(`[ArrayBuffers.toString] Unsupported encoding for string: ${t}`)}if(f.isNativeBufferAllowed())return Buffer.from(f.asView(Uint8Array,e)).toString(t);switch(t){case"hex":return[...f.asView(Uint8Array,e)].map(r=>rt[r]).join("");case"base64":return et(f.asView(Uint8Array,e));case"utf8":case"utf-8":return new TextDecoder().decode(e);case"ascii":{const r=f.asView(Uint8Array,e);return String.fromCharCode(...r.map(n=>n&127))}case"latin1":case"binary":{const r=f.asView(Uint8Array,e);return String.fromCharCode(...r)}case"ucs2":case"ucs-2":case"utf16le":{const r=f.asView(Uint8Array,e);let n="";for(let o=0;o<r.length-1;o+=2)n+=String.fromCharCode(r[o]+r[o+1]*256);return n}default:throw new Error(`[ArrayBuffers.toString] Unknown encoding: ${t}`)}},u.toJSON=(e,t)=>JSON.parse(f.toString(e),t),u.alloc=(e,t,r)=>t!==void 0?typeof t=="number"?new Uint8Array(e).fill(t):f.asView(Uint8Array,f.from(t,r)).slice(0,e):new ArrayBuffer(e),u.from=(e,t="utf8")=>{if(!e)return new ArrayBuffer(0);if(typeof e=="string"){if(f.isNativeBufferAllowed())return Buffer.from(e,t);switch(t){case"utf-8":case"utf8":return new TextEncoder().encode(e).buffer;case"base64":return tt(e.replace(/[^0-9a-zA-Z=+/_]/g,""));default:throw new Error(`[ArrayBuffers.from] Unknown encoding: ${t}`)}}if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e)||B(e)){if(e.byteOffset!==0)throw new Error("ArrayBuffers.from do not support view with offset");return e.buffer}if(Array.isArray(e))return new Uint8Array(e);const r=$(e);throw new TypeError(`ArrayBuffers.from unsupported type ${r}`)},u.isEncoding=e=>{switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":return!0;default:return!1}},u.concat=(e,t,r=0)=>{const n=e.reduce((a,s)=>a+s.byteLength,0),o=t?new Uint8Array(t):new Uint8Array(n);for(const a of e){if(!(a!=null&&a.byteLength))continue;let s;if(a instanceof ArrayBuffer)s=new Uint8Array(a);else if(ArrayBuffer.isView(a))s=new Uint8Array(a.buffer,a.byteOffset,a.byteLength);else throw new Error(`ArrayBuffers.concat unsupported type ${$(a)}`);o.set(s,r),r+=a.byteLength}return o.buffer};const rt=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=r*16;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}(),L=class extends Uint8Array{static get isPolyfill(){return!0}static isBuffer(t){return t instanceof L||B(t)}static from(t,r){return new L(u.from(t,r))}toString(t){return u.toString(this,t)}};let re=L;re.isEncoding=u.isEncoding;let D;function nt(){let e;function t(){return navigator.userAgent.match(/ipad|iphone/i)}function r(a){e=document.createElement("textArea"),e.value=a,document.body.appendChild(e)}function n(){let a,s;if(t()){if(a=document.createRange(),a.selectNodeContents(e),s=window.getSelection(),s===null){console.error("no selection");return}s.removeAllRanges(),s.addRange(a),e.setSelectionRange(0,999999)}else e.select()}function o(){document.execCommand("copy"),document.body.removeChild(e)}D=a=>{r(a),n(),o()}}function ot(e){var t,r;return(r=(t=window.navigator)==null?void 0:t.clipboard)!=null&&r.writeText?window.navigator.clipboard.writeText(e):(D||nt(),D(e))}function at(e,t,{type:r="application/octet-stream",raw:n=!1}={}){const o=document.createElement("a");let a=()=>null;try{if(o.download=e,typeof t=="string"&&/^(https?:|data:)/.test(t)&&!n?o.href=t:typeof t=="string"&&(t=new TextEncoder().encode(t)),t instanceof Uint8Array&&(t=new Blob([t],{type:r})),t instanceof File||t instanceof Blob||t instanceof MediaSource)o.href=URL.createObjectURL(t),a=()=>{URL.revokeObjectURL(o.href)};else throw console.error("invalid download data",t),new Error(`can not download ${Object.getPrototypeOf(t)}`);o.click()}finally{a()}}function ne(e,t,r,n){e.onload=()=>{t(e)},e.onerror=a=>{e.remove(),r(a)};const{attributes:o={}}=n||{};Object.entries(o).forEach(([a,s])=>{e.setAttribute(a,s)}),document.head.appendChild(e)}function oe(e,t){if(Array.isArray(e))return Promise.resolve().then(async()=>{const n=[];for(const o of e)n.push(await oe(o));return n});const r=document.querySelector(`script[src="${e}"]`);return r?Promise.resolve(r):new Promise((n,o)=>{const a=document.createElement("script");a.src=e,ne(a,n,o,t)})}function st(e,t){const r=document.querySelector(`link[href="${e}"]`);return r?Promise.resolve(r):new Promise((n,o)=>{const a=document.createElement("link");a.rel="stylesheet",a.href=e,ne(a,n,o,t)})}function it(e){var t;if(!e)return{};const r=e.items??[];if(r.length>=2&&r[0].kind==="string"&&r[1].kind==="file"){const n=e.getData("text"),o=r[1].getAsFile()??((t=e.files)==null?void 0:t.item(0));return o?{file:o,name:n}:(console.error(`no file ${n}`,r[1]),{})}else if(r[0].kind==="file"){const n=r[0].getAsFile();return n?{file:n,name:n.name}:(console.error("no file",r[0]),{})}else console.debug("file item not match",Array.from(r).map(n=>({type:n.type,kind:n.kind})));return{}}const ct=d.globalThis.structuredClone||w;function ae(e,t,r){typeof r.value=="object"&&(r.value=w(r.value)),!r.enumerable||r.get||r.set||!r.configurable||!r.writable||t==="__proto__"?Object.defineProperty(e,t,r):e[t]=r.value}function w(e){if(typeof e!="object")return e;let t=0,r,n,o;const a=$(e);switch(a){case"Array":o=Array(e.length);break;case"Object":o=Object.create(e.__proto__||null);break;case"Set":o=new Set,e.forEach(function(s){o.add(w(s))});break;case"Map":o=new Map,e.forEach(function(s,i){o.set(w(i),w(s))});break;case"Date":o=new Date(+e);break;case"RegExp":o=new RegExp(e.source,e.flags);break;case"DataView":o=new e.constructor(w(e.buffer));break;case"ArrayBuffer":o=e.slice(0);break;default:a.endsWith("Array")&&(o=new e.constructor(e))}if(o){for(n=Object.getOwnPropertySymbols(e);t<n.length;t++)ae(o,n[t],Object.getOwnPropertyDescriptor(e,n[t]));for(t=0,n=Object.getOwnPropertyNames(e);t<n.length;t++)Object.hasOwnProperty.call(o,r=n[t])&&o[r]===e[r]||ae(o,r,Object.getOwnPropertyDescriptor(e,r))}return o||e}var se,ie;const lt=((ie=(se=d.globalThis.crypto)==null?void 0:se.randomUUID)==null?void 0:ie.bind(d.globalThis.crypto))||ut;function ut(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}let V;if(typeof window>"u")try{typeof require>"u"?import("crypto").then(e=>V=e.default):V=require("crypto")}catch{}function ft(){return V}var ce,le,ue,fe;exports.getRandomValues=((le=(ce=d.globalThis.crypto)==null?void 0:ce.getRandomValues)==null?void 0:le.bind(d.globalThis.crypto))||((fe=(ue=d.globalThis.msCrypto)==null?void 0:ue.getRandomValues)==null?void 0:fe.bind(d.globalThis.msCrypto))||dt;function dt(e){var t,r,n;const o=ft();if((t=o==null?void 0:o.webcrypto)!=null&&t.getRandomValues)return exports.getRandomValues=(n=(r=o==null?void 0:o.webcrypto)==null?void 0:r.getRandomValues)==null?void 0:n.bind(o==null?void 0:o.webcrypto),o.webcrypto.getRandomValues(e);if(o!=null&&o.randomBytes){if(!(e instanceof Uint8Array))throw new TypeError("expected Uint8Array");if(e.length>65536){const s=new Error;throw s.code=22,s.message=`Failed to execute 'getRandomValues' on 'Crypto': The ArrayBufferView's byte length (${e.length}) exceeds the number of bytes of entropy available via this API (65536).`,s.name="QuotaExceededError",s}const a=o.randomBytes(e.length);return e.set(a),e}throw new Error("[getRandomValues]: No secure random number generator available.")}function yt(e){return C("SHA-1",e)}function ht(e){return C("SHA-256",e)}function pt(e){return C("SHA-384",e)}function gt(e){return C("SHA-512",e)}function C(e,t){return crypto.subtle.digest(e,mt(t))}function mt(e){return typeof e=="string"?new TextEncoder().encode(e):e}function wt(e){return Array.from(new Uint8Array(e)).map(t=>t.toString(16).padStart(2,"0")).join("")}function y(e){const t=new Error(e);return t.source="ulid",t}const h="0123456789ABCDEFGHJKMNPQRSTVWXYZ",p=h.length,_=Math.pow(2,48)-1,b=10,N=16;function bt(e){return(e==null?void 0:e.length)===26&&/^[0-9A-HJKMNP-TV-Z]{26}$/i.test(e)}function de(e,t,r){return t>e.length-1?e:e.substr(0,t)+r+e.substr(t+1)}function At(e){let t,r=e.length,n,o;const a=p-1;for(;!t&&r-->=0;){if(n=e[r],o=h.indexOf(n),o===-1)throw y("incorrectly encoded string");if(o===a){e=de(e,r,h[0]);continue}t=de(e,r,h[o+1])}if(typeof t=="string")return t;throw y("cannot increment this string")}function vt(e){let t=Math.floor(e()*p);return t===p&&(t=p-1),h.charAt(t)}function I(e,t){if(isNaN(e))throw new Error(`${e} must be a number`);if(e>_)throw y(`cannot encode time greater than ${_}`);if(e<0)throw y("time must be positive");if(!Number.isInteger(e))throw y("time must be an integer");let r,n="";for(;t>0;t--)r=e%p,n=h.charAt(r)+n,e=(e-r)/p;return n}function ye(e,t){let r="";for(;e>0;e--)r=vt(t)+r;return r}function $t(e){if(e.length!==b+N)throw y("malformed ulid");const t=e.substr(0,b).split("").reverse().reduce((r,n,o)=>{const a=h.indexOf(n);if(a===-1)throw y("invalid character found: "+n);return r+=a*Math.pow(p,o)},0);if(t>_)throw y("malformed ulid, timestamp too large");return{timestamp:t,random:e.substring(b)}}function Bt(){return()=>{const e=new Uint8Array(1);return exports.getRandomValues(e),e[0]/255}}function he({monotonic:e=!0,random:t=Bt(),now:r=Date.now}={}){if(!e)return function(a){return a||=r(),I(a,b)+ye(N,t)};let n=0,o;return function(a){if(a||=r(),a<=n&&o){const i=o=At(o);return I(n,b)+i}n=a;const s=o=ye(N,t);return I(a,b)+s}}exports.ulid=(...e)=>E?E(...e):(E=he(),exports.ulid=E,E(...e));let E;class Ot{static decode(t){const r=t.match(/^-----BEGIN (?<type>[^\r\n-]+)-----$\r?\n(?<headers>(^[^:\r\n]+:[^\n\r]+\r?\n)+\r?\n)?(?<data>[a-zA-Z0-9/_=\n\r+]+?)^-----END \1-----$\r?\n?/ms);if(!(r!=null&&r.groups))throw new Error("Invalid PEM data");const{type:n,headers:o="",data:a}=r.groups,s=o.split(`
2
2
  `).filter(i=>i.trim()).map(i=>{const[c,...l]=i.split(":");return[c.trim(),l.join(":").trim()]}).reduce((i,[c,l])=>({...i,[c]:l}),{});return{block:{type:n,header:s,bytes:u.from(a.replace(/[\r\n]/g,""),"base64")},head:t.slice(0,r.index||0),tail:t.slice((r.index||0)+r[0].length)}}static encode(t){var r;const{type:n,header:o,bytes:a}=t,s=Object.entries(o||{}).map(([i,c])=>`${i}: ${c}`).join(`
3
3
  `);return`-----BEGIN ${n}-----
4
4
  ${s}${s.length?`
@@ -6,5 +6,5 @@ ${s}${s.length?`
6
6
  `:""}${((r=u.toString(a,"base64").match(/.{1,64}/g))==null?void 0:r.join(`
7
7
  `))||""}
8
8
  -----END ${n}-----
9
- `}}function Ot(e={}){let t=typeof e.seed=="string"?0:e.seed??0;if(typeof e.seed=="string"){let r=0;for(let n=0;n<e.seed.length;n++)r+=e.seed.charCodeAt(n);t=r}return()=>{const r=Math.sin(t++)*1e4;return r-Math.floor(r)}}function jt(e,t){try{if(typeof e=="string"&&e.length>0)return xt(e);if(typeof e=="number"&&isFinite(e))return t!=null&&t.long?Tt(e):Ct(e);throw new Error("Value is not a string or number.")}catch(r){const n=Ut(r)?`${r.message}. value=${JSON.stringify(e)}`:"An unknown error has occurred.";throw new Error(n)}}function xt(e){if(e.length>100)throw new Error("Value exceeds the maximum length of 100 characters.");const t=/^(?<value>-?(?:\d+)?\.?\d+) *(?<type>milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e),r=t==null?void 0:t.groups;if(!r)return NaN;const n=parseFloat(r.value),o=(r.type||"ms").toLowerCase();switch(o){case"years":case"year":case"yrs":case"yr":case"y":return n*315576e5;case"weeks":case"week":case"w":return n*6048e5;case"days":case"day":case"d":return n*864e5;case"hours":case"hour":case"hrs":case"hr":case"h":return n*36e5;case"minutes":case"minute":case"mins":case"min":case"m":return n*6e4;case"seconds":case"second":case"secs":case"sec":case"s":return n*1e3;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:throw new Error(`The unit ${o} was matched, but no matching case exists.`)}}function Ct(e){const t=Math.abs(e);return t>=864e5?`${Math.round(e/864e5)}d`:t>=36e5?`${Math.round(e/36e5)}h`:t>=6e4?`${Math.round(e/6e4)}m`:t>=1e3?`${Math.round(e/1e3)}s`:`${e}ms`}function Tt(e){const t=Math.abs(e);return t>=864e5?C(e,t,864e5,"day"):t>=36e5?C(e,t,36e5,"hour"):t>=6e4?C(e,t,6e4,"minute"):t>=1e3?C(e,t,1e3,"second"):`${e} ms`}function C(e,t,r,n){const o=t>=r*1.5;return`${Math.round(e/r)} ${n}${o?"s":""}`}function Ut(e){return typeof e=="object"&&e!==null&&"message"in e}exports.ArrayBuffers=u,exports.Buffer=te,exports.PEM=Et,exports.TimeoutError=z,exports.arrayFromAsync=Ee,exports.arrayOfMaybeArray=Be,exports.camelCase=H,exports.classOf=v,exports.clearAsyncInterval=Ce,exports.copy=nt,exports.createChildLogger=Ze,exports.createLazyPromise=je,exports.createLogger=M,exports.createNoopLogger=G,exports.createRandom=Ot,exports.createTranslate=Ke,exports.createULID=ye,exports.deepEqual=A,exports.download=ot,exports.firstOfMaybeArray=R,exports.formatBytes=Je,exports.get=U,exports.getFileFromDataTransfer=st,exports.getGlobalThis=it,exports.hex=wt,exports.isBuffer=$,exports.isClass=ke,exports.isDefined=Le,exports.isEmptyObject=De,exports.isModule=qe,exports.isPlainObject=Z,exports.isPromise=F,exports.isTransferable=Ye,exports.isULID=bt,exports.isUUID=Ie,exports.lastOfMaybeArray=$e,exports.loadScripts=ne,exports.loadStyles=at,exports.maybeFunction=_e,exports.memoize=Ne,exports.ms=jt,exports.objectOfMaybeArray=ve,exports.parseBoolean=Ve,exports.parseModuleId=ze,exports.parseObjectPath=T,exports.parseTimestamp=Re,exports.parseULID=$t,exports.pascalCase=He,exports.randomUUID=lt,exports.renderTemplate=J,exports.set=Oe,exports.setAsyncInterval=xe,exports.sha1=yt,exports.sha256=ht,exports.sha384=pt,exports.sha512=gt,exports.shallowClone=Pe,exports.shallowEqual=Se,exports.sleep=Te,exports.structuredClone=ct,exports.timeout=Ue;
9
+ `}}function jt(e={}){let t=typeof e.seed=="string"?0:e.seed??0;if(typeof e.seed=="string"){let r=0;for(let n=0;n<e.seed.length;n++)r+=e.seed.charCodeAt(n);t=r}return()=>{const r=Math.sin(t++)*1e4;return r-Math.floor(r)}}function Et(e,t){try{if(typeof e=="string"&&e.length>0)return xt(e);if(typeof e=="number"&&isFinite(e))return t!=null&&t.long?Tt(e):Ct(e);throw new Error("Value is not a string or number.")}catch(r){const n=Ut(r)?`${r.message}. value=${JSON.stringify(e)}`:"An unknown error has occurred.";throw new Error(n)}}function xt(e){if(e.length>100)throw new Error("Value exceeds the maximum length of 100 characters.");const t=/^(?<value>-?(?:\d+)?\.?\d+) *(?<type>milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e),r=t==null?void 0:t.groups;if(!r)return NaN;const n=parseFloat(r.value),o=(r.type||"ms").toLowerCase();switch(o){case"years":case"year":case"yrs":case"yr":case"y":return n*315576e5;case"weeks":case"week":case"w":return n*6048e5;case"days":case"day":case"d":return n*864e5;case"hours":case"hour":case"hrs":case"hr":case"h":return n*36e5;case"minutes":case"minute":case"mins":case"min":case"m":return n*6e4;case"seconds":case"second":case"secs":case"sec":case"s":return n*1e3;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:throw new Error(`The unit ${o} was matched, but no matching case exists.`)}}function Ct(e){const t=Math.abs(e);return t>=864e5?`${Math.round(e/864e5)}d`:t>=36e5?`${Math.round(e/36e5)}h`:t>=6e4?`${Math.round(e/6e4)}m`:t>=1e3?`${Math.round(e/1e3)}s`:`${e}ms`}function Tt(e){const t=Math.abs(e);return t>=864e5?T(e,t,864e5,"day"):t>=36e5?T(e,t,36e5,"hour"):t>=6e4?T(e,t,6e4,"minute"):t>=1e3?T(e,t,1e3,"second"):`${e} ms`}function T(e,t,r,n){const o=t>=r*1.5;return`${Math.round(e/r)} ${n}${o?"s":""}`}function Ut(e){return typeof e=="object"&&e!==null&&"message"in e}exports.getGlobalThis=d.getGlobalThis,exports.globalThis=d.globalThis,exports.ArrayBuffers=u,exports.Buffer=re,exports.PEM=Ot,exports.TimeoutError=q,exports.arrayFromAsync=je,exports.arrayOfMaybeArray=Oe,exports.camelCase=J,exports.classOf=$,exports.clearAsyncInterval=Te,exports.copy=ot,exports.createChildLogger=Ge,exports.createLazyPromise=xe,exports.createLogger=P,exports.createNoopLogger=H,exports.createRandom=jt,exports.createTranslate=Ye,exports.createULID=he,exports.deepEqual=v,exports.download=at,exports.firstOfMaybeArray=F,exports.formatBytes=Ke,exports.get=S,exports.getFileFromDataTransfer=it,exports.hex=wt,exports.isBuffer=B,exports.isClass=Le,exports.isDefined=De,exports.isEmptyObject=Ve,exports.isModule=We,exports.isPlainObject=G,exports.isPromise=z,exports.isTransferable=Qe,exports.isULID=bt,exports.isUUID=Re,exports.lastOfMaybeArray=Be,exports.loadScripts=oe,exports.loadStyles=st,exports.maybeFunction=Ne,exports.memoize=Ie,exports.ms=Et,exports.objectOfMaybeArray=$e,exports.parseBoolean=_e,exports.parseModuleId=qe,exports.parseObjectPath=U,exports.parseTimestamp=Fe,exports.parseULID=$t,exports.pascalCase=Je,exports.randomUUID=lt,exports.renderTemplate=K,exports.set=Ee,exports.setAsyncInterval=Ce,exports.sha1=yt,exports.sha256=ht,exports.sha384=pt,exports.sha512=gt,exports.shallowClone=ke,exports.shallowEqual=Me,exports.sleep=Ue,exports.structuredClone=ct,exports.timeout=Se;
10
10
  //# sourceMappingURL=index.cjs.map