@vxrn/utils 1.12.2 → 1.12.4

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/dist/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export * from "@vxrn/debug";
2
2
  export * from "@vxrn/resolve";
3
- export * from "./detectPackageManager";
4
- export * from "./exec";
5
- export * from "./mustReplace";
3
+ export * from "./detectPackageManager.mjs";
4
+ export * from "./exec.mjs";
5
+ export * from "./mustReplace.mjs";
6
6
  //# sourceMappingURL=index.js.map
@@ -1,6 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.ts"],
4
- "mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
5
- "names": []
6
- }
1
+ {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vxrn/utils",
3
- "version": "1.12.2",
3
+ "version": "1.12.4",
4
4
  "sideEffects": false,
5
5
  "type": "module",
6
6
  "types": "./types/index.d.ts",
@@ -33,11 +33,11 @@
33
33
  "typecheck": "tsc --noEmit"
34
34
  },
35
35
  "dependencies": {
36
- "@vxrn/debug": "1.12.2",
37
- "@vxrn/resolve": "1.12.2"
36
+ "@vxrn/debug": "1.12.4",
37
+ "@vxrn/resolve": "1.12.4"
38
38
  },
39
39
  "devDependencies": {
40
- "@tamagui/build": "2.0.0-rc.22"
40
+ "@tamagui/build": "2.0.0-rc.28"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public"
@@ -1,74 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: !0 });
8
- }, __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from == "object" || typeof from == "function")
10
- for (let key of __getOwnPropNames(from))
11
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
- var detectPackageManager_exports = {};
16
- __export(detectPackageManager_exports, {
17
- detectPackageManager: () => detectPackageManager
18
- });
19
- module.exports = __toCommonJS(detectPackageManager_exports);
20
- var import_node_fs = require("node:fs"), import_node_path = require("node:path"), import_exec = require("./exec");
21
- async function pathExists(p) {
22
- try {
23
- return await import_node_fs.promises.access(p), !0;
24
- } catch {
25
- return !1;
26
- }
27
- }
28
- async function hasGlobal(pm) {
29
- try {
30
- const command = process.platform === "win32" ? `where ${pm}` : `which ${pm}`;
31
- return !!(0, import_exec.exec)(command).length;
32
- } catch {
33
- return !1;
34
- }
35
- }
36
- async function getFromLockfile(cwd = ".") {
37
- const [yarn, npm, pnpm, bun] = await Promise.all([
38
- pathExists((0, import_node_path.resolve)(cwd, "yarn.lock")),
39
- pathExists((0, import_node_path.resolve)(cwd, "package-lock.json")),
40
- pathExists((0, import_node_path.resolve)(cwd, "pnpm-lock.yaml")),
41
- pathExists((0, import_node_path.resolve)(cwd, "bun.lockb"))
42
- ]);
43
- return { bun, yarn, pnpm, npm };
44
- }
45
- async function getFromPackage(cwd = ".") {
46
- if (await pathExists((0, import_node_path.resolve)(cwd, "package.json"))) {
47
- const json = JSON.parse(await import_node_fs.promises.readFile((0, import_node_path.resolve)(cwd, "package.json"), "utf-8"));
48
- if (json.packageManager) {
49
- const yarn = !!json.packageManager.startsWith("yarn"), pnpm = !!json.packageManager.startsWith("pnpm"), bun = !!json.packageManager.startsWith("bun"), npm = !!json.packageManager.startsWith("npm");
50
- return { bun, yarn, pnpm, npm };
51
- }
52
- }
53
- }
54
- const foundSome = (obj) => Object.keys(obj).some((k) => !!obj[k]), detectPackageManager = async ({ cwd } = {}) => {
55
- const fromLockfile = await getFromLockfile(cwd);
56
- if (foundSome(fromLockfile))
57
- return fromLockfile;
58
- const fromPackageJson = await getFromPackage(cwd);
59
- if (fromPackageJson && foundSome(fromPackageJson))
60
- return fromPackageJson;
61
- const [npm, yarn, pnpm, bun] = await Promise.all([
62
- hasGlobal("npm"),
63
- hasGlobal("yarn"),
64
- hasGlobal("pnpm"),
65
- hasGlobal("bun")
66
- ]);
67
- return {
68
- bun,
69
- yarn,
70
- pnpm,
71
- npm
72
- };
73
- };
74
- //# sourceMappingURL=detectPackageManager.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/detectPackageManager.ts"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA+B,oBAC/B,mBAAwB,sBACxB,cAAqB;AAIrB,eAAe,WAAW,GAAW;AACnC,MAAI;AACF,iBAAM,eAAAA,SAAG,OAAO,CAAC,GACV;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,eAAe,UAAU,IAA0C;AACjE,MAAI;AACF,UAAM,UAAU,QAAQ,aAAa,UAAU,SAAS,EAAE,KAAK,SAAS,EAAE;AAE1E,WAAO,CAAC,KADI,kBAAK,OAAO,EACX;AAAA,EACf,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,eAAe,gBAAgB,MAAM,KAAK;AACxC,QAAM,CAAC,MAAM,KAAK,MAAM,GAAG,IAAI,MAAM,QAAQ,IAAI;AAAA,IAC/C,eAAW,0BAAQ,KAAK,WAAW,CAAC;AAAA,IACpC,eAAW,0BAAQ,KAAK,mBAAmB,CAAC;AAAA,IAC5C,eAAW,0BAAQ,KAAK,gBAAgB,CAAC;AAAA,IACzC,eAAW,0BAAQ,KAAK,WAAW,CAA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ertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: !0 });
8
- }, __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from == "object" || typeof from == "function")
10
- for (let key of __getOwnPropNames(from))
11
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
- var exec_exports = {};
16
- __export(exec_exports, {
17
- exec: () => exec,
18
- execPromise: () => execPromise,
19
- execPromiseQuiet: () => execPromiseQuiet
20
- });
21
- module.exports = __toCommonJS(exec_exports);
22
- var import_node_child_process = require("node:child_process");
23
- const exec = (cmd, options) => (0, import_node_child_process.execSync)(cmd, options)?.toString() || "", execPromise = (cmd, options) => new Promise((resolve, reject) => {
24
- const [command, ...args] = cmd.split(" "), child = (0, import_node_child_process.spawn)(command, args, {
25
- stdio: options?.quiet ? "pipe" : "inherit",
26
- shell: !0,
27
- ...options
28
- });
29
- (!options?.quiet || process.env.DEBUG) && (child.stdout?.pipe(process.stdout), child.stderr?.pipe(process.stderr)), child.on("close", (code) => {
30
- code !== 0 ? reject(new Error(`Command failed with exit code ${code}: ${cmd}`)) : resolve();
31
- }), child.on("error", (error) => {
32
- reject(error);
33
- });
34
- }), execPromiseQuiet = (cmd, options) => execPromise(cmd, {
35
- ...options,
36
- quiet: !0
37
- });
38
- //# sourceMappingURL=exec.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/exec.ts"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gCAAmD;AAG5C,MAAM,OAAO,CAAC,KAAa,gBACzB,oCAAS,KAAK,OAAO,GAAG,SAAS,KAAK,IAGlC,cAAc,CACzB,KACA,YAIO,IAAI,QAAc,CAAC,SAAS,WAAW;AAC5C,QAAM,CAAC,SAAS,GAAG,IAAI,IAAI,IAAI,MAAM,GAAG,GAElC,YAAQ,iCAAM,SAAS,MAAM;AAAA,IACjC,OAAO,SAAS,QAAQ,SAAS;AAAA,IACjC,OAAO;AAAA,IACP,GAAG;AAAA,EACL,CAAC;AAED,GAAI,CAAC,SAAS,SAAS,QAAQ,IAAI,WACjC,MAAM,QAAQ,KAAK,QAAQ,MAAM,GACjC,MAAM,QAAQ,KAAK,QAAQ,MAAM,IAGnC,MAAM,GAAG,SAAS,CAAC,SAAS;AAC1B,IAAI,SAAS,IACX,OAAO,IAAI,MAAM,iCAAiC,IAAI,KAAK,GAAG,EAAE,CAAC,IAEjE,QAAQ;AAAA,EAEZ,CAAC,GAED,MAAM,GAAG,SAAS,CAAC,UAAU;AAC3B,WAAO,KAAK;AAAA,EACd,CAAC;AACH,CAAC,GAGU,mBAAmB,CAC9B,KACA,YAIO,YAAY,KAAK;AAAA,EACtB,GAAG;AAAA,EACH,OAAO;AACT,CAAC;",
5
- "names": []
6
- }
package/dist/cjs/index.js DELETED
@@ -1,19 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from == "object" || typeof from == "function")
7
- for (let key of __getOwnPropNames(from))
8
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
- return to;
10
- }, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
11
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
- var index_exports = {};
13
- module.exports = __toCommonJS(index_exports);
14
- __reExport(index_exports, require("@vxrn/debug"), module.exports);
15
- __reExport(index_exports, require("@vxrn/resolve"), module.exports);
16
- __reExport(index_exports, require("./detectPackageManager"), module.exports);
17
- __reExport(index_exports, require("./exec"), module.exports);
18
- __reExport(index_exports, require("./mustReplace"), module.exports);
19
- //# sourceMappingURL=index.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.ts"],
4
- "mappings": ";;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,wBAAd;AACA,0BAAc,0BADd;AAEA,0BAAc,mCAFd;AAGA,0BAAc,mBAHd;AAIA,0BAAc,0BAJd;",
5
- "names": []
6
- }
@@ -1,34 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: !0 });
8
- }, __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from == "object" || typeof from == "function")
10
- for (let key of __getOwnPropNames(from))
11
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
- var mustReplace_exports = {};
16
- __export(mustReplace_exports, {
17
- mustReplace: () => mustReplace
18
- });
19
- module.exports = __toCommonJS(mustReplace_exports);
20
- var import_node_fs = require("node:fs"), import_node_os = require("node:os"), import_node_path = require("node:path");
21
- function mustReplace(source, replacements) {
22
- let sourceOut = source;
23
- for (const { find, replace, optional } of replacements) {
24
- if (!optional && !(find instanceof RegExp ? find.test(sourceOut) : sourceOut.includes(find))) {
25
- const tmpPath = (0, import_node_path.join)((0, import_node_os.tmpdir)(), `replace-error-${Math.random()}`);
26
- throw (0, import_node_fs.writeFileSync)(tmpPath, sourceOut, "utf-8"), new Error(
27
- `Substring or pattern "${find}" not found in the string, replacing in source: ${tmpPath}.`
28
- );
29
- }
30
- sourceOut = sourceOut.replace(find, replace);
31
- }
32
- return sourceOut;
33
- }
34
- //# sourceMappingURL=mustReplace.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/mustReplace.ts"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA8B,oBAC9B,iBAAuB,oBACvB,mBAAqB;AAEd,SAAS,YACd,QACA,cAKA;AACA,MAAI,YAAY;AAChB,aAAW,EAAE,MAAM,SAAS,SAAS,KAAK,cAAc;AACtD,QAAI,CAAC,YAGC,EADF,gBAAgB,SAAS,KAAK,KAAK,SAAS,IAAI,UAAU,SAAS,IAAI,IAC7D;AACV,YAAM,cAAU,2BAAK,uBAAO,GAAG,iBAAiB,KAAK,OAAO,CAAC,EAAE;AAC/D,8CAAc,SAAS,WAAW,OAAO,GACnC,IAAI;AAAA,QACR,yBAAyB,IAAI,mDAAmD,OAAO;AAAA,MACzF;AAAA,IACF;AAIF,gBAAY,UAAU,QAAQ,MAAM,OAAO;AAAA,EAC7C;AACA,SAAO;AACT;",
5
- "names": []
6
- }
@@ -1,60 +0,0 @@
1
- import { promises as fs } from "node:fs";
2
- import { resolve } from "node:path";
3
- import { exec } from "./exec";
4
- async function pathExists(p) {
5
- try {
6
- return await fs.access(p), !0;
7
- } catch {
8
- return !1;
9
- }
10
- }
11
- async function hasGlobal(pm) {
12
- try {
13
- const command = process.platform === "win32" ? `where ${pm}` : `which ${pm}`;
14
- return !!exec(command).length;
15
- } catch {
16
- return !1;
17
- }
18
- }
19
- async function getFromLockfile(cwd = ".") {
20
- const [yarn, npm, pnpm, bun] = await Promise.all([
21
- pathExists(resolve(cwd, "yarn.lock")),
22
- pathExists(resolve(cwd, "package-lock.json")),
23
- pathExists(resolve(cwd, "pnpm-lock.yaml")),
24
- pathExists(resolve(cwd, "bun.lockb"))
25
- ]);
26
- return { bun, yarn, pnpm, npm };
27
- }
28
- async function getFromPackage(cwd = ".") {
29
- if (await pathExists(resolve(cwd, "package.json"))) {
30
- const json = JSON.parse(await fs.readFile(resolve(cwd, "package.json"), "utf-8"));
31
- if (json.packageManager) {
32
- const yarn = !!json.packageManager.startsWith("yarn"), pnpm = !!json.packageManager.startsWith("pnpm"), bun = !!json.packageManager.startsWith("bun"), npm = !!json.packageManager.startsWith("npm");
33
- return { bun, yarn, pnpm, npm };
34
- }
35
- }
36
- }
37
- const foundSome = (obj) => Object.keys(obj).some((k) => !!obj[k]), detectPackageManager = async ({ cwd } = {}) => {
38
- const fromLockfile = await getFromLockfile(cwd);
39
- if (foundSome(fromLockfile))
40
- return fromLockfile;
41
- const fromPackageJson = await getFromPackage(cwd);
42
- if (fromPackageJson && foundSome(fromPackageJson))
43
- return fromPackageJson;
44
- const [npm, yarn, pnpm, bun] = await Promise.all([
45
- hasGlobal("npm"),
46
- hasGlobal("yarn"),
47
- hasGlobal("pnpm"),
48
- hasGlobal("bun")
49
- ]);
50
- return {
51
- bun,
52
- yarn,
53
- pnpm,
54
- npm
55
- };
56
- };
57
- export {
58
- detectPackageManager
59
- };
60
- //# sourceMappingURL=detectPackageManager.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/detectPackageManager.ts"],
4
- "mappings": "AAAA,SAAS,YAAY,UAAU;AAC/B,SAAS,eAAe;AACxB,SAAS,YAAY;AAIrB,eAAe,WAAW,GAAW;AACnC,MAAI;AACF,iBAAM,GAAG,OAAO,CAAC,GACV;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,eAAe,UAAU,IAA0C;AACjE,MAAI;AACF,UAAM,UAAU,QAAQ,aAAa,UAAU,SAAS,EAAE,KAAK,SAAS,EAAE;AAE1E,WAAO,CAAC,CADI,KAAK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AAI,MAAM,QAAQ,IAAI;AAAA,IAC/C,UAAU,KAAK;AAAA,IACf,UAAU,MAAM;AAAA,IAChB,UAAU,MAAM;AAAA,IAChB,UAAU,KAAK;AAAA,EACjB,CAAC;AAED,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
5
- "names": []
6
- }
package/dist/esm/exec.js DELETED
@@ -1,22 +0,0 @@
1
- import { execSync, spawn } from "node:child_process";
2
- const exec = (cmd, options) => execSync(cmd, options)?.toString() || "", execPromise = (cmd, options) => new Promise((resolve, reject) => {
3
- const [command, ...args] = cmd.split(" "), child = spawn(command, args, {
4
- stdio: options?.quiet ? "pipe" : "inherit",
5
- shell: !0,
6
- ...options
7
- });
8
- (!options?.quiet || process.env.DEBUG) && (child.stdout?.pipe(process.stdout), child.stderr?.pipe(process.stderr)), child.on("close", (code) => {
9
- code !== 0 ? reject(new Error(`Command failed with exit code ${code}: ${cmd}`)) : resolve();
10
- }), child.on("error", (error) => {
11
- reject(error);
12
- });
13
- }), execPromiseQuiet = (cmd, options) => execPromise(cmd, {
14
- ...options,
15
- quiet: !0
16
- });
17
- export {
18
- exec,
19
- execPromise,
20
- execPromiseQuiet
21
- };
22
- //# sourceMappingURL=exec.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/exec.ts"],
4
- "mappings": "AAAA,SAAS,UAA6B,aAAa;AAG5C,MAAM,OAAO,CAAC,KAAa,YACzB,SAAS,KAAK,OAAO,GAAG,SAAS,KAAK,IAGlC,cAAc,CACzB,KACA,YAIO,IAAI,QAAc,CAAC,SAAS,WAAW;AAC5C,QAAM,CAAC,SAAS,GAAG,IAAI,IAAI,IAAI,MAAM,GAAG,GAElC,QAAQ,MAAM,SAAS,MAAM;AAAA,IACjC,OAAO,SAAS,QAAQ,SAAS;AAAA,IACjC,OAAO;AAAA,IACP,GAAG;AAAA,EACL,CAAC;AAED,GAAI,CAAC,SAAS,SAAS,QAAQ,IAAI,WACjC,MAAM,QAAQ,KAAK,QAAQ,MAAM,GACjC,MAAM,QAAQ,KAAK,QAAQ,MAAM,IAGnC,MAAM,GAAG,SAAS,CAAC,SAAS;AAC1B,IAAI,SAAS,IACX,OAAO,IAAI,MAAM,iCAAiC,IAAI,KAAK,GAAG,EAAE,CAAC,IAEjE,QAAQ;AAAA,EAEZ,CAAC,GAED,MAAM,GAAG,SAAS,CAAC,UAAU;AAC3B,WAAO,KAAK;AAAA,EACd,CAAC;AACH,CAAC,GAGU,mBAAmB,CAC9B,KACA,YAIO,YAAY,KAAK;AAAA,EACtB,GAAG;AAAA,EACH,OAAO;AACT,CAAC;",
5
- "names": []
6
- }
@@ -1,20 +0,0 @@
1
- import { writeFileSync } from "node:fs";
2
- import { tmpdir } from "node:os";
3
- import { join } from "node:path";
4
- function mustReplace(source, replacements) {
5
- let sourceOut = source;
6
- for (const { find, replace, optional } of replacements) {
7
- if (!optional && !(find instanceof RegExp ? find.test(sourceOut) : sourceOut.includes(find))) {
8
- const tmpPath = join(tmpdir(), `replace-error-${Math.random()}`);
9
- throw writeFileSync(tmpPath, sourceOut, "utf-8"), new Error(
10
- `Substring or pattern "${find}" not found in the string, replacing in source: ${tmpPath}.`
11
- );
12
- }
13
- sourceOut = sourceOut.replace(find, replace);
14
- }
15
- return sourceOut;
16
- }
17
- export {
18
- mustReplace
19
- };
20
- //# sourceMappingURL=mustReplace.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/mustReplace.ts"],
4
- "mappings": "AAAA,SAAS,qBAAqB;AAC9B,SAAS,cAAc;AACvB,SAAS,YAAY;AAEd,SAAS,YACd,QACA,cAKA;AACA,MAAI,YAAY;AAChB,aAAW,EAAE,MAAM,SAAS,SAAS,KAAK,cAAc;AACtD,QAAI,CAAC,YAGC,EADF,gBAAgB,SAAS,KAAK,KAAK,SAAS,IAAI,UAAU,SAAS,IAAI,IAC7D;AACV,YAAM,UAAU,KAAK,OAAO,GAAG,iBAAiB,KAAK,OAAO,CAAC,EAAE;AAC/D,0BAAc,SAAS,WAAW,OAAO,GACnC,IAAI;AAAA,QACR,yBAAyB,IAAI,mDAAmD,OAAO;AAAA,MACzF;AAAA,IACF;AAIF,gBAAY,UAAU,QAAQ,MAAM,OAAO;AAAA,EAC7C;AACA,SAAO;AACT;",
5
- "names": []
6
- }