likec4 1.48.0 → 1.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -1
- package/__app__/src/likec4.js +5941 -4496
- package/__app__/src/routes/index.js +3 -153
- package/__app__/src/routes/projects.js +21 -1087
- package/__app__/src/routes/single.js +1228 -16
- package/__app__/src/style.css +1 -1
- package/__app__/src/vendors.js +4649 -1897
- package/__app__/src/webcomponent.js +1 -1
- package/config/schema.json +169 -141
- package/dist/THIRD-PARTY-LICENSES.md +1769 -0
- package/dist/_chunks/LikeC4.mjs +1154 -202
- package/dist/_chunks/binary.mjs +72 -0
- package/dist/_chunks/index.d.mts +234 -140
- package/dist/_chunks/index2.d.mts +2043 -1828
- package/dist/_chunks/libs/@chevrotain/cst-dts-gen.mjs +30 -0
- package/dist/_chunks/libs/@chevrotain/regexp-to-ast.mjs +9 -785
- package/dist/_chunks/libs/@chevrotain/utils.mjs +1 -37
- package/dist/_chunks/libs/@hono/mcp.mjs +34 -0
- package/dist/_chunks/libs/@hono/node-server.mjs +1 -436
- package/dist/_chunks/libs/@logtape/logtape.d.mts +741 -0
- package/dist/_chunks/libs/@logtape/logtape.mjs +6 -1354
- package/dist/_chunks/libs/@lume/kiwi.mjs +1 -1355
- package/dist/_chunks/libs/@modelcontextprotocol/sdk.d.mts +114 -14
- package/dist/_chunks/libs/@modelcontextprotocol/sdk.mjs +12 -25105
- package/dist/_chunks/libs/@msgpack/msgpack.mjs +1 -1503
- package/dist/_chunks/libs/@nanostores/react.d.mts +61 -1
- package/dist/_chunks/libs/@nanostores/react.mjs +1 -30
- package/dist/_chunks/libs/@smithy/is-array-buffer.mjs +1 -10
- package/dist/_chunks/libs/@smithy/util-base64.mjs +1 -100
- package/dist/_chunks/libs/ajv.mjs +1 -777
- package/dist/_chunks/libs/atomically.mjs +1 -362
- package/dist/_chunks/libs/birpc.mjs +1 -201
- package/dist/_chunks/libs/chevrotain-allstar.mjs +2 -850
- package/dist/_chunks/libs/chevrotain.mjs +55 -6229
- package/dist/_chunks/libs/conf.mjs +1 -2258
- package/dist/_chunks/libs/defu.mjs +1 -42
- package/dist/_chunks/libs/esm-env.mjs +1 -5
- package/dist/_chunks/libs/eventemitter3.mjs +1 -243
- package/dist/_chunks/libs/fast-equals.mjs +1 -446
- package/dist/_chunks/libs/find-up-simple.mjs +1 -24
- package/dist/_chunks/libs/get-port.mjs +1 -107
- package/dist/_chunks/libs/is-docker.mjs +1 -26
- package/dist/_chunks/libs/is-error-instance.mjs +1 -26
- package/dist/_chunks/libs/is-inside-container.mjs +1 -20
- package/dist/_chunks/libs/is-plain-obj.mjs +1 -9
- package/dist/_chunks/libs/isexe.mjs +1 -127
- package/dist/_chunks/libs/json5.mjs +14 -959
- package/dist/_chunks/libs/khroma.mjs +1 -605
- package/dist/_chunks/libs/ky.mjs +2 -807
- package/dist/_chunks/libs/langium.d.mts +2913 -2876
- package/dist/_chunks/libs/langium.mjs +33 -20351
- package/dist/_chunks/libs/merge-error-cause.mjs +2 -746
- package/dist/_chunks/libs/p-limit.mjs +1 -120
- package/dist/_chunks/libs/p-queue.mjs +1 -449
- package/dist/_chunks/libs/package-manager-detector.mjs +1 -559
- package/dist/_chunks/libs/package-up.mjs +1 -10
- package/dist/_chunks/libs/pako.mjs +1 -0
- package/dist/_chunks/libs/parse-ms.mjs +1 -36
- package/dist/_chunks/libs/pathe.mjs +1 -0
- package/dist/_chunks/libs/picomatch.mjs +1 -1673
- package/dist/_chunks/libs/pretty-ms.mjs +1 -80
- package/dist/_chunks/libs/remeda.mjs +2 -690
- package/dist/_chunks/libs/safe-stringify.mjs +1 -21
- package/dist/_chunks/libs/strip-indent.mjs +1 -15
- package/dist/_chunks/libs/tinyrainbow.mjs +1 -88
- package/dist/_chunks/libs/ts-graphviz.mjs +4 -725
- package/dist/_chunks/libs/ufo.mjs +1 -240
- package/dist/_chunks/libs/which.mjs +1 -84
- package/dist/_chunks/libs/word-wrap.mjs +12 -43
- package/dist/_chunks/rolldown-runtime.mjs +1 -48
- package/dist/_chunks/sequence.mjs +1 -0
- package/dist/_chunks/src.mjs +15 -0
- package/dist/_chunks/src2.mjs +499 -0
- package/dist/cli/index.mjs +77 -1952
- package/dist/config/index.d.mts +2 -2
- package/dist/config/index.mjs +1 -6
- package/dist/index.d.mts +150 -7
- package/dist/index.mjs +1 -21
- package/dist/model/builder.mjs +1 -3
- package/dist/model/index.d.mts +57 -3
- package/dist/model/index.mjs +1 -5
- package/dist/vite-plugin/index.d.mts +7 -3
- package/dist/vite-plugin/index.mjs +1 -22
- package/dist/vite-plugin/internal.d.mts +6 -7
- package/dist/vite-plugin/internal.mjs +1 -68
- package/package.json +64 -45
- package/react/{index.d.ts → index.d.mts} +114 -72
- package/react/{index.js → index.mjs} +21320 -22041
- package/react/package.json +2 -5
- package/vite-plugin-modules.d.ts +10 -5
- package/dist/_chunks/LikeC4.d.mts +0 -121
- package/dist/_chunks/config-app.prod.d.mts +0 -18
- package/dist/_chunks/config-app.prod.mjs +0 -188
- package/dist/_chunks/config-webcomponent.prod.mjs +0 -71
- package/dist/_chunks/define-config.mjs +0 -409
- package/dist/_chunks/index3.d.mts +0 -60
- package/dist/_chunks/libs/@chevrotain/gast.mjs +0 -3969
- package/dist/_chunks/libs/hono.mjs +0 -1829
- package/dist/_chunks/libs/nanoid.mjs +0 -29
- package/dist/_chunks/libs/nanostores.d.mts +0 -63
- package/dist/_chunks/libs/nanostores.mjs +0 -198
- package/dist/_chunks/model.mjs +0 -12
- package/dist/_chunks/module.d.mts +0 -71
- package/dist/_chunks/module.mjs +0 -18657
- package/dist/_chunks/plugin.mjs +0 -996
- package/dist/_chunks/sequence-view.mjs +0 -575
- package/dist/_chunks/vite-build.mjs +0 -69
- package/dist/_chunks/vite-dev.mjs +0 -79
- package/dist/_chunks/vite-preview.mjs +0 -27
- package/dist/language/module.d.mts +0 -5
- package/dist/language/module.mjs +0 -20
- package/dist/vite/vite-build.d.mts +0 -26
- package/dist/vite/vite-build.mjs +0 -27
- package/dist/vite/vite-dev.d.mts +0 -34
- package/dist/vite/vite-dev.mjs +0 -29
- package/dist/vite/vite-preview.d.mts +0 -20
- package/dist/vite/vite-preview.mjs +0 -26
- /package/dist/_chunks/{index4.d.mts → libs/@chevrotain/types.d.mts} +0 -0
|
@@ -213,6 +213,66 @@ interface PreinitializedMapStore<Value extends object = any> extends MapStore<Va
|
|
|
213
213
|
*/
|
|
214
214
|
declare function map<Value extends object, StoreExt extends object = object>(value?: Value): PreinitializedMapStore<Value> & StoreExt;
|
|
215
215
|
//#endregion
|
|
216
|
+
//#region ../../node_modules/.pnpm/nanostores@1.1.0/node_modules/nanostores/task/index.d.ts
|
|
217
|
+
interface Task<Value> extends Promise<Value> {
|
|
218
|
+
t: true;
|
|
219
|
+
}
|
|
220
|
+
//#endregion
|
|
221
|
+
//#region ../../node_modules/.pnpm/nanostores@1.1.0/node_modules/nanostores/computed/index.d.ts
|
|
222
|
+
type StoreValues<Stores extends AnyStore[]> = { [Index in keyof Stores]: StoreValue<Stores[Index]> };
|
|
223
|
+
interface Computed {
|
|
224
|
+
<Value, OriginStore extends Store>(stores: OriginStore, cb: (value: StoreValue<OriginStore>) => Task<Value>): ReadableAtom<undefined | Value>;
|
|
225
|
+
<Value, OriginStores extends AnyStore[]>(stores: [...OriginStores], cb: (...values: StoreValues<OriginStores>) => Task<Value>): ReadableAtom<undefined | Value>;
|
|
226
|
+
<Value, OriginStore extends Store>(stores: OriginStore, cb: (value: StoreValue<OriginStore>) => Value): ReadableAtom<Value>;
|
|
227
|
+
/**
|
|
228
|
+
* Create derived store, which use generates value from another stores.
|
|
229
|
+
*
|
|
230
|
+
* ```js
|
|
231
|
+
* import { computed } from 'nanostores'
|
|
232
|
+
*
|
|
233
|
+
* import { $users } from './users.js'
|
|
234
|
+
*
|
|
235
|
+
* export const $admins = computed($users, users => {
|
|
236
|
+
* return users.filter(user => user.isAdmin)
|
|
237
|
+
* })
|
|
238
|
+
* ```
|
|
239
|
+
*
|
|
240
|
+
* An async function can be evaluated by using {@link task}.
|
|
241
|
+
*
|
|
242
|
+
* ```js
|
|
243
|
+
* import { computed, task } from 'nanostores'
|
|
244
|
+
*
|
|
245
|
+
* import { $userId } from './users.js'
|
|
246
|
+
*
|
|
247
|
+
* export const $user = computed($userId, userId => task(async () => {
|
|
248
|
+
* const response = await fetch(`https://my-api/users/${userId}`)
|
|
249
|
+
* return response.json()
|
|
250
|
+
* }))
|
|
251
|
+
* ```
|
|
252
|
+
*/
|
|
253
|
+
<Value, OriginStores extends AnyStore[]>(stores: [...OriginStores], cb: (...values: StoreValues<OriginStores>) => Task<Value> | Value): ReadableAtom<Value>;
|
|
254
|
+
}
|
|
255
|
+
declare const computed: Computed;
|
|
256
|
+
interface Batched {
|
|
257
|
+
<Value, OriginStore extends Store>(stores: OriginStore, cb: (value: StoreValue<OriginStore>) => Task<Value> | Value): ReadableAtom<Value>;
|
|
258
|
+
/**
|
|
259
|
+
* Create derived store, which use generates value from another stores.
|
|
260
|
+
*
|
|
261
|
+
* ```js
|
|
262
|
+
* import { batched } from 'nanostores'
|
|
263
|
+
*
|
|
264
|
+
* const $sortBy = atom('id')
|
|
265
|
+
* const $category = atom('')
|
|
266
|
+
*
|
|
267
|
+
* export const $link = batched([$sortBy, $category], (sortBy, category) => {
|
|
268
|
+
* return `/api/entities?sortBy=${sortBy}&category=${category}`
|
|
269
|
+
* })
|
|
270
|
+
* ```
|
|
271
|
+
*/
|
|
272
|
+
<Value, OriginStores extends AnyStore[]>(stores: [...OriginStores], cb: (...values: StoreValues<OriginStores>) => Task<Value> | Value): ReadableAtom<Value>;
|
|
273
|
+
}
|
|
274
|
+
declare const batched: Batched;
|
|
275
|
+
//#endregion
|
|
216
276
|
//#region ../../node_modules/.pnpm/@nanostores+react@1.0.0_nanostores@1.1.0_react@19.2.4/node_modules/@nanostores/react/index.d.ts
|
|
217
277
|
type StoreKeys<T> = T extends {
|
|
218
278
|
setKey: (k: infer K, v: any) => unknown;
|
|
@@ -255,4 +315,4 @@ interface UseStoreOptions<SomeStore> {
|
|
|
255
315
|
*/
|
|
256
316
|
declare function useStore<SomeStore extends Store>(store: SomeStore, options?: UseStoreOptions<SomeStore>): StoreValue<SomeStore>;
|
|
257
317
|
//#endregion
|
|
258
|
-
export {
|
|
318
|
+
export { Atom as a, atom as c, map as i, batched as n, ReadableAtom as o, computed as r, WritableAtom as s, useStore as t };
|
|
@@ -1,30 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
//#region ../../node_modules/.pnpm/nanostores@1.1.0/node_modules/nanostores/listen-keys/index.js
|
|
4
|
-
function listenKeys($store, keys, listener) {
|
|
5
|
-
let keysSet = new Set(keys).add(void 0);
|
|
6
|
-
return $store.listen((value, oldValue, changed) => {
|
|
7
|
-
if (keysSet.has(changed)) listener(value, oldValue, changed);
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
//#endregion
|
|
12
|
-
//#region ../../node_modules/.pnpm/@nanostores+react@1.0.0_nanostores@1.1.0_react@19.2.4/node_modules/@nanostores/react/index.js
|
|
13
|
-
let emit = (snapshotRef, onChange) => (value) => {
|
|
14
|
-
if (snapshotRef.current === value) return;
|
|
15
|
-
snapshotRef.current = value;
|
|
16
|
-
onChange();
|
|
17
|
-
};
|
|
18
|
-
function useStore(store, { keys, deps = [store, keys] } = {}) {
|
|
19
|
-
let snapshotRef = useRef();
|
|
20
|
-
snapshotRef.current = store.get();
|
|
21
|
-
let subscribe = useCallback((onChange) => {
|
|
22
|
-
emit(snapshotRef, onChange)(store.value);
|
|
23
|
-
return keys?.length > 0 ? listenKeys(store, keys, emit(snapshotRef, onChange)) : store.listen(emit(snapshotRef, onChange));
|
|
24
|
-
}, deps);
|
|
25
|
-
let get = () => snapshotRef.current;
|
|
26
|
-
return useSyncExternalStore(subscribe, get, get);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
//#endregion
|
|
30
|
-
export { useStore as t };
|
|
1
|
+
import{useCallback as e,useRef as t,useSyncExternalStore as n}from"react";let r=Symbol(`clean`),i=[],a=0,o=0;const s=e=>{let t=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},lc:0,listen(e){return n.lc=t.push(e),()=>{for(let t=a+4;t<i.length;)i[t]===e?i.splice(t,4):t+=4;let r=t.indexOf(e);~r&&(t.splice(r,1),--n.lc||n.off())}},notify(e,r){o++;let s=!i.length;for(let a of t)i.push(a,n.value,e,r);if(s){for(a=0;a<i.length;a+=4)i[a](i[a+1],i[a+2],i[a+3]);i.length=0}},off(){},set(e){let t=n.value;t!==e&&(n.value=e,n.notify(t))},subscribe(e){let t=n.listen(e);return e(n.value),t},value:e};return process.env.NODE_ENV!==`production`&&(n[r]=()=>{t=[],n.lc=0,n.off()}),n};let c=(e,t,n,r)=>(e.events=e.events||{},e.events[n+10]||(e.events[n+10]=r(t=>{e.events[n].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let r=e.events[n],i=r.indexOf(t);r.splice(i,1),r.length||(delete e.events[n],e.events[n+10](),delete e.events[n+10])}),l=(e,t)=>{let n=n=>{let r=t(n);r&&e.events[6].push(r)};return c(e,n,5,t=>{let n=e.listen;e.listen=(...r)=>(!e.lc&&!e.active&&(e.active=!0,t()),n(...r));let i=e.off;if(e.events[6]=[],e.off=()=>{i(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let t of e.events[6])t();e.events[6]=[]}},1e3)},process.env.NODE_ENV!==`production`){let t=e[r];e[r]=()=>{for(let t of e.events[6])t();e.events[6]=[],e.active=!1,t()}}return()=>{e.listen=n,e.off=i}})},u=(e,t,n)=>{Array.isArray(e)||(e=[e]);let r,i,a=()=>{if(i===o)return;i=o;let n=e.map(e=>e.get());if(!r||n.some((e,t)=>e!==r[t])){r=n;let e=t(...n);e&&e.then&&e.t?e.then(e=>{r===n&&c.set(e)}):(c.set(e),i=o)}},c=s(void 0),u=c.get;c.get=()=>(a(),u());let d,f=n?()=>{clearTimeout(d),d=setTimeout(a)}:a;return l(c,()=>{let t=e.map(e=>e.listen(f));return a(),()=>{for(let e of t)e()}}),c};const d=(e,t)=>u(e,t),f=(e,t)=>u(e,t,!0);function p(e,t,n){let r=new Set(t).add(void 0);return e.listen((e,t,i)=>{r.has(i)&&n(e,t,i)})}const m=(e={})=>{let t=s(e);return t.setKey=function(e,n){let r=t.value;n===void 0&&e in t.value?(t.value={...t.value},delete t.value[e],t.notify(r,e)):t.value[e]!==n&&(t.value={...t.value,[e]:n},t.notify(r,e))},t};let h=(e,t)=>n=>{e.current!==n&&(e.current=n,t())};function g(r,{keys:i,deps:a=[r,i]}={}){let o=t();o.current=r.get();let s=e(e=>(h(o,e)(r.value),i?.length>0?p(r,i,h(o,e)):r.listen(h(o,e))),a),c=()=>o.current;return n(s,c,c)}export{s as a,d as i,m as n,f as r,g as t};
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
//#region ../../node_modules/.pnpm/@smithy+is-array-buffer@4.2.0/node_modules/@smithy/is-array-buffer/dist-cjs/index.js
|
|
4
|
-
var require_dist_cjs = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5
|
-
const isArrayBuffer = (arg) => typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer || Object.prototype.toString.call(arg) === "[object ArrayBuffer]";
|
|
6
|
-
exports.isArrayBuffer = isArrayBuffer;
|
|
7
|
-
}));
|
|
8
|
-
|
|
9
|
-
//#endregion
|
|
10
|
-
export { require_dist_cjs as t };
|
|
1
|
+
export{};
|
|
@@ -1,100 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { t as require_dist_cjs$3 } from "./is-array-buffer.mjs";
|
|
3
|
-
|
|
4
|
-
//#region ../../node_modules/.pnpm/@smithy+util-buffer-from@4.2.0/node_modules/@smithy/util-buffer-from/dist-cjs/index.js
|
|
5
|
-
var require_dist_cjs$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
6
|
-
var isArrayBuffer = require_dist_cjs$3();
|
|
7
|
-
var buffer = __require("buffer");
|
|
8
|
-
const fromArrayBuffer = (input, offset = 0, length = input.byteLength - offset) => {
|
|
9
|
-
if (!isArrayBuffer.isArrayBuffer(input)) throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`);
|
|
10
|
-
return buffer.Buffer.from(input, offset, length);
|
|
11
|
-
};
|
|
12
|
-
const fromString = (input, encoding) => {
|
|
13
|
-
if (typeof input !== "string") throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`);
|
|
14
|
-
return encoding ? buffer.Buffer.from(input, encoding) : buffer.Buffer.from(input);
|
|
15
|
-
};
|
|
16
|
-
exports.fromArrayBuffer = fromArrayBuffer;
|
|
17
|
-
exports.fromString = fromString;
|
|
18
|
-
}));
|
|
19
|
-
|
|
20
|
-
//#endregion
|
|
21
|
-
//#region ../../node_modules/.pnpm/@smithy+util-base64@4.3.0/node_modules/@smithy/util-base64/dist-cjs/fromBase64.js
|
|
22
|
-
var require_fromBase64 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
23
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.fromBase64 = void 0;
|
|
25
|
-
const util_buffer_from_1 = require_dist_cjs$2();
|
|
26
|
-
const BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/;
|
|
27
|
-
const fromBase64 = (input) => {
|
|
28
|
-
if (input.length * 3 % 4 !== 0) throw new TypeError(`Incorrect padding on base64 string.`);
|
|
29
|
-
if (!BASE64_REGEX.exec(input)) throw new TypeError(`Invalid base64 string.`);
|
|
30
|
-
const buffer = (0, util_buffer_from_1.fromString)(input, "base64");
|
|
31
|
-
return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);
|
|
32
|
-
};
|
|
33
|
-
exports.fromBase64 = fromBase64;
|
|
34
|
-
}));
|
|
35
|
-
|
|
36
|
-
//#endregion
|
|
37
|
-
//#region ../../node_modules/.pnpm/@smithy+util-utf8@4.2.0/node_modules/@smithy/util-utf8/dist-cjs/index.js
|
|
38
|
-
var require_dist_cjs$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
39
|
-
var utilBufferFrom = require_dist_cjs$2();
|
|
40
|
-
const fromUtf8 = (input) => {
|
|
41
|
-
const buf = utilBufferFrom.fromString(input, "utf8");
|
|
42
|
-
return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT);
|
|
43
|
-
};
|
|
44
|
-
const toUint8Array = (data) => {
|
|
45
|
-
if (typeof data === "string") return fromUtf8(data);
|
|
46
|
-
if (ArrayBuffer.isView(data)) return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);
|
|
47
|
-
return new Uint8Array(data);
|
|
48
|
-
};
|
|
49
|
-
const toUtf8 = (input) => {
|
|
50
|
-
if (typeof input === "string") return input;
|
|
51
|
-
if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");
|
|
52
|
-
return utilBufferFrom.fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString("utf8");
|
|
53
|
-
};
|
|
54
|
-
exports.fromUtf8 = fromUtf8;
|
|
55
|
-
exports.toUint8Array = toUint8Array;
|
|
56
|
-
exports.toUtf8 = toUtf8;
|
|
57
|
-
}));
|
|
58
|
-
|
|
59
|
-
//#endregion
|
|
60
|
-
//#region ../../node_modules/.pnpm/@smithy+util-base64@4.3.0/node_modules/@smithy/util-base64/dist-cjs/toBase64.js
|
|
61
|
-
var require_toBase64 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
62
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
63
|
-
exports.toBase64 = void 0;
|
|
64
|
-
const util_buffer_from_1 = require_dist_cjs$2();
|
|
65
|
-
const util_utf8_1 = require_dist_cjs$1();
|
|
66
|
-
const toBase64 = (_input) => {
|
|
67
|
-
let input;
|
|
68
|
-
if (typeof _input === "string") input = (0, util_utf8_1.fromUtf8)(_input);
|
|
69
|
-
else input = _input;
|
|
70
|
-
if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");
|
|
71
|
-
return (0, util_buffer_from_1.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString("base64");
|
|
72
|
-
};
|
|
73
|
-
exports.toBase64 = toBase64;
|
|
74
|
-
}));
|
|
75
|
-
|
|
76
|
-
//#endregion
|
|
77
|
-
//#region ../../node_modules/.pnpm/@smithy+util-base64@4.3.0/node_modules/@smithy/util-base64/dist-cjs/index.js
|
|
78
|
-
var require_dist_cjs = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
79
|
-
var fromBase64 = require_fromBase64();
|
|
80
|
-
var toBase64 = require_toBase64();
|
|
81
|
-
Object.keys(fromBase64).forEach(function(k) {
|
|
82
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
83
|
-
enumerable: true,
|
|
84
|
-
get: function() {
|
|
85
|
-
return fromBase64[k];
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
Object.keys(toBase64).forEach(function(k) {
|
|
90
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
91
|
-
enumerable: true,
|
|
92
|
-
get: function() {
|
|
93
|
-
return toBase64[k];
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
}));
|
|
98
|
-
|
|
99
|
-
//#endregion
|
|
100
|
-
export { require_dist_cjs as t };
|
|
1
|
+
import{Buffer as e}from"buffer";const t=(t,n)=>{if(typeof t!=`string`)throw TypeError(`The "input" argument must be of type string. Received type ${typeof t} (${t})`);return n?e.from(t,n):e.from(t)},n=/^[A-Za-z0-9+/]*={0,2}$/,r=e=>{if(e.length*3%4!=0)throw TypeError(`Incorrect padding on base64 string.`);if(!n.exec(e))throw TypeError(`Invalid base64 string.`);let r=t(e,`base64`);return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)};export{r as t};
|