@uipath/api-workflow-tool 0.9.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,1799 @@
1
- // ../packager/packager-tool-apiworkflow/src/i18n/index.ts
2
- import { I18nManager } from "@uipath/solutionpackager-tool-core";
1
+ // ../../node_modules/fflate/esm/index.mjs
2
+ import { createRequire } from "module";
3
+ var require2 = createRequire("/");
4
+ var Worker;
5
+ try {
6
+ Worker = require2("worker_threads").Worker;
7
+ } catch (e) {}
8
+ var u8 = Uint8Array;
9
+ var u16 = Uint16Array;
10
+ var i32 = Int32Array;
11
+ var fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0]);
12
+ var fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0]);
13
+ var clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
14
+ var freb = function(eb, start) {
15
+ var b = new u16(31);
16
+ for (var i = 0;i < 31; ++i) {
17
+ b[i] = start += 1 << eb[i - 1];
18
+ }
19
+ var r = new i32(b[30]);
20
+ for (var i = 1;i < 30; ++i) {
21
+ for (var j = b[i];j < b[i + 1]; ++j) {
22
+ r[j] = j - b[i] << 5 | i;
23
+ }
24
+ }
25
+ return { b, r };
26
+ };
27
+ var _a = freb(fleb, 2);
28
+ var fl = _a.b;
29
+ var revfl = _a.r;
30
+ fl[28] = 258, revfl[258] = 28;
31
+ var _b = freb(fdeb, 0);
32
+ var fd = _b.b;
33
+ var revfd = _b.r;
34
+ var rev = new u16(32768);
35
+ for (i = 0;i < 32768; ++i) {
36
+ x = (i & 43690) >> 1 | (i & 21845) << 1;
37
+ x = (x & 52428) >> 2 | (x & 13107) << 2;
38
+ x = (x & 61680) >> 4 | (x & 3855) << 4;
39
+ rev[i] = ((x & 65280) >> 8 | (x & 255) << 8) >> 1;
40
+ }
41
+ var x;
42
+ var i;
43
+ var hMap = function(cd, mb, r) {
44
+ var s = cd.length;
45
+ var i2 = 0;
46
+ var l = new u16(mb);
47
+ for (;i2 < s; ++i2) {
48
+ if (cd[i2])
49
+ ++l[cd[i2] - 1];
50
+ }
51
+ var le = new u16(mb);
52
+ for (i2 = 1;i2 < mb; ++i2) {
53
+ le[i2] = le[i2 - 1] + l[i2 - 1] << 1;
54
+ }
55
+ var co;
56
+ if (r) {
57
+ co = new u16(1 << mb);
58
+ var rvb = 15 - mb;
59
+ for (i2 = 0;i2 < s; ++i2) {
60
+ if (cd[i2]) {
61
+ var sv = i2 << 4 | cd[i2];
62
+ var r_1 = mb - cd[i2];
63
+ var v = le[cd[i2] - 1]++ << r_1;
64
+ for (var m = v | (1 << r_1) - 1;v <= m; ++v) {
65
+ co[rev[v] >> rvb] = sv;
66
+ }
67
+ }
68
+ }
69
+ } else {
70
+ co = new u16(s);
71
+ for (i2 = 0;i2 < s; ++i2) {
72
+ if (cd[i2]) {
73
+ co[i2] = rev[le[cd[i2] - 1]++] >> 15 - cd[i2];
74
+ }
75
+ }
76
+ }
77
+ return co;
78
+ };
79
+ var flt = new u8(288);
80
+ for (i = 0;i < 144; ++i)
81
+ flt[i] = 8;
82
+ var i;
83
+ for (i = 144;i < 256; ++i)
84
+ flt[i] = 9;
85
+ var i;
86
+ for (i = 256;i < 280; ++i)
87
+ flt[i] = 7;
88
+ var i;
89
+ for (i = 280;i < 288; ++i)
90
+ flt[i] = 8;
91
+ var i;
92
+ var fdt = new u8(32);
93
+ for (i = 0;i < 32; ++i)
94
+ fdt[i] = 5;
95
+ var i;
96
+ var flm = /* @__PURE__ */ hMap(flt, 9, 0);
97
+ var fdm = /* @__PURE__ */ hMap(fdt, 5, 0);
98
+ var shft = function(p) {
99
+ return (p + 7) / 8 | 0;
100
+ };
101
+ var slc = function(v, s, e) {
102
+ if (s == null || s < 0)
103
+ s = 0;
104
+ if (e == null || e > v.length)
105
+ e = v.length;
106
+ return new u8(v.subarray(s, e));
107
+ };
108
+ var ec = [
109
+ "unexpected EOF",
110
+ "invalid block type",
111
+ "invalid length/literal",
112
+ "invalid distance",
113
+ "stream finished",
114
+ "no stream handler",
115
+ ,
116
+ "no callback",
117
+ "invalid UTF-8 data",
118
+ "extra field too long",
119
+ "date not in range 1980-2099",
120
+ "filename too long",
121
+ "stream finishing",
122
+ "invalid zip data"
123
+ ];
124
+ var err = function(ind, msg, nt) {
125
+ var e = new Error(msg || ec[ind]);
126
+ e.code = ind;
127
+ if (Error.captureStackTrace)
128
+ Error.captureStackTrace(e, err);
129
+ if (!nt)
130
+ throw e;
131
+ return e;
132
+ };
133
+ var wbits = function(d, p, v) {
134
+ v <<= p & 7;
135
+ var o = p / 8 | 0;
136
+ d[o] |= v;
137
+ d[o + 1] |= v >> 8;
138
+ };
139
+ var wbits16 = function(d, p, v) {
140
+ v <<= p & 7;
141
+ var o = p / 8 | 0;
142
+ d[o] |= v;
143
+ d[o + 1] |= v >> 8;
144
+ d[o + 2] |= v >> 16;
145
+ };
146
+ var hTree = function(d, mb) {
147
+ var t = [];
148
+ for (var i2 = 0;i2 < d.length; ++i2) {
149
+ if (d[i2])
150
+ t.push({ s: i2, f: d[i2] });
151
+ }
152
+ var s = t.length;
153
+ var t2 = t.slice();
154
+ if (!s)
155
+ return { t: et, l: 0 };
156
+ if (s == 1) {
157
+ var v = new u8(t[0].s + 1);
158
+ v[t[0].s] = 1;
159
+ return { t: v, l: 1 };
160
+ }
161
+ t.sort(function(a, b) {
162
+ return a.f - b.f;
163
+ });
164
+ t.push({ s: -1, f: 25001 });
165
+ var l = t[0], r = t[1], i0 = 0, i1 = 1, i22 = 2;
166
+ t[0] = { s: -1, f: l.f + r.f, l, r };
167
+ while (i1 != s - 1) {
168
+ l = t[t[i0].f < t[i22].f ? i0++ : i22++];
169
+ r = t[i0 != i1 && t[i0].f < t[i22].f ? i0++ : i22++];
170
+ t[i1++] = { s: -1, f: l.f + r.f, l, r };
171
+ }
172
+ var maxSym = t2[0].s;
173
+ for (var i2 = 1;i2 < s; ++i2) {
174
+ if (t2[i2].s > maxSym)
175
+ maxSym = t2[i2].s;
176
+ }
177
+ var tr = new u16(maxSym + 1);
178
+ var mbt = ln(t[i1 - 1], tr, 0);
179
+ if (mbt > mb) {
180
+ var i2 = 0, dt = 0;
181
+ var lft = mbt - mb, cst = 1 << lft;
182
+ t2.sort(function(a, b) {
183
+ return tr[b.s] - tr[a.s] || a.f - b.f;
184
+ });
185
+ for (;i2 < s; ++i2) {
186
+ var i2_1 = t2[i2].s;
187
+ if (tr[i2_1] > mb) {
188
+ dt += cst - (1 << mbt - tr[i2_1]);
189
+ tr[i2_1] = mb;
190
+ } else
191
+ break;
192
+ }
193
+ dt >>= lft;
194
+ while (dt > 0) {
195
+ var i2_2 = t2[i2].s;
196
+ if (tr[i2_2] < mb)
197
+ dt -= 1 << mb - tr[i2_2]++ - 1;
198
+ else
199
+ ++i2;
200
+ }
201
+ for (;i2 >= 0 && dt; --i2) {
202
+ var i2_3 = t2[i2].s;
203
+ if (tr[i2_3] == mb) {
204
+ --tr[i2_3];
205
+ ++dt;
206
+ }
207
+ }
208
+ mbt = mb;
209
+ }
210
+ return { t: new u8(tr), l: mbt };
211
+ };
212
+ var ln = function(n, l, d) {
213
+ return n.s == -1 ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1)) : l[n.s] = d;
214
+ };
215
+ var lc = function(c) {
216
+ var s = c.length;
217
+ while (s && !c[--s])
218
+ ;
219
+ var cl = new u16(++s);
220
+ var cli = 0, cln = c[0], cls = 1;
221
+ var w = function(v) {
222
+ cl[cli++] = v;
223
+ };
224
+ for (var i2 = 1;i2 <= s; ++i2) {
225
+ if (c[i2] == cln && i2 != s)
226
+ ++cls;
227
+ else {
228
+ if (!cln && cls > 2) {
229
+ for (;cls > 138; cls -= 138)
230
+ w(32754);
231
+ if (cls > 2) {
232
+ w(cls > 10 ? cls - 11 << 5 | 28690 : cls - 3 << 5 | 12305);
233
+ cls = 0;
234
+ }
235
+ } else if (cls > 3) {
236
+ w(cln), --cls;
237
+ for (;cls > 6; cls -= 6)
238
+ w(8304);
239
+ if (cls > 2)
240
+ w(cls - 3 << 5 | 8208), cls = 0;
241
+ }
242
+ while (cls--)
243
+ w(cln);
244
+ cls = 1;
245
+ cln = c[i2];
246
+ }
247
+ }
248
+ return { c: cl.subarray(0, cli), n: s };
249
+ };
250
+ var clen = function(cf, cl) {
251
+ var l = 0;
252
+ for (var i2 = 0;i2 < cl.length; ++i2)
253
+ l += cf[i2] * cl[i2];
254
+ return l;
255
+ };
256
+ var wfblk = function(out, pos, dat) {
257
+ var s = dat.length;
258
+ var o = shft(pos + 2);
259
+ out[o] = s & 255;
260
+ out[o + 1] = s >> 8;
261
+ out[o + 2] = out[o] ^ 255;
262
+ out[o + 3] = out[o + 1] ^ 255;
263
+ for (var i2 = 0;i2 < s; ++i2)
264
+ out[o + i2 + 4] = dat[i2];
265
+ return (o + 4 + s) * 8;
266
+ };
267
+ var wblk = function(dat, out, final, syms, lf, df, eb, li, bs, bl, p) {
268
+ wbits(out, p++, final);
269
+ ++lf[256];
270
+ var _a2 = hTree(lf, 15), dlt = _a2.t, mlb = _a2.l;
271
+ var _b2 = hTree(df, 15), ddt = _b2.t, mdb = _b2.l;
272
+ var _c = lc(dlt), lclt = _c.c, nlc = _c.n;
273
+ var _d = lc(ddt), lcdt = _d.c, ndc = _d.n;
274
+ var lcfreq = new u16(19);
275
+ for (var i2 = 0;i2 < lclt.length; ++i2)
276
+ ++lcfreq[lclt[i2] & 31];
277
+ for (var i2 = 0;i2 < lcdt.length; ++i2)
278
+ ++lcfreq[lcdt[i2] & 31];
279
+ var _e = hTree(lcfreq, 7), lct = _e.t, mlcb = _e.l;
280
+ var nlcc = 19;
281
+ for (;nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)
282
+ ;
283
+ var flen = bl + 5 << 3;
284
+ var ftlen = clen(lf, flt) + clen(df, fdt) + eb;
285
+ var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + 2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18];
286
+ if (bs >= 0 && flen <= ftlen && flen <= dtlen)
287
+ return wfblk(out, p, dat.subarray(bs, bs + bl));
288
+ var lm, ll, dm, dl;
289
+ wbits(out, p, 1 + (dtlen < ftlen)), p += 2;
290
+ if (dtlen < ftlen) {
291
+ lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;
292
+ var llm = hMap(lct, mlcb, 0);
293
+ wbits(out, p, nlc - 257);
294
+ wbits(out, p + 5, ndc - 1);
295
+ wbits(out, p + 10, nlcc - 4);
296
+ p += 14;
297
+ for (var i2 = 0;i2 < nlcc; ++i2)
298
+ wbits(out, p + 3 * i2, lct[clim[i2]]);
299
+ p += 3 * nlcc;
300
+ var lcts = [lclt, lcdt];
301
+ for (var it = 0;it < 2; ++it) {
302
+ var clct = lcts[it];
303
+ for (var i2 = 0;i2 < clct.length; ++i2) {
304
+ var len = clct[i2] & 31;
305
+ wbits(out, p, llm[len]), p += lct[len];
306
+ if (len > 15)
307
+ wbits(out, p, clct[i2] >> 5 & 127), p += clct[i2] >> 12;
308
+ }
309
+ }
310
+ } else {
311
+ lm = flm, ll = flt, dm = fdm, dl = fdt;
312
+ }
313
+ for (var i2 = 0;i2 < li; ++i2) {
314
+ var sym = syms[i2];
315
+ if (sym > 255) {
316
+ var len = sym >> 18 & 31;
317
+ wbits16(out, p, lm[len + 257]), p += ll[len + 257];
318
+ if (len > 7)
319
+ wbits(out, p, sym >> 23 & 31), p += fleb[len];
320
+ var dst = sym & 31;
321
+ wbits16(out, p, dm[dst]), p += dl[dst];
322
+ if (dst > 3)
323
+ wbits16(out, p, sym >> 5 & 8191), p += fdeb[dst];
324
+ } else {
325
+ wbits16(out, p, lm[sym]), p += ll[sym];
326
+ }
327
+ }
328
+ wbits16(out, p, lm[256]);
329
+ return p + ll[256];
330
+ };
331
+ var deo = /* @__PURE__ */ new i32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);
332
+ var et = /* @__PURE__ */ new u8(0);
333
+ var dflt = function(dat, lvl, plvl, pre, post, st) {
334
+ var s = st.z || dat.length;
335
+ var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);
336
+ var w = o.subarray(pre, o.length - post);
337
+ var lst = st.l;
338
+ var pos = (st.r || 0) & 7;
339
+ if (lvl) {
340
+ if (pos)
341
+ w[0] = st.r >> 3;
342
+ var opt = deo[lvl - 1];
343
+ var n = opt >> 13, c = opt & 8191;
344
+ var msk_1 = (1 << plvl) - 1;
345
+ var prev = st.p || new u16(32768), head = st.h || new u16(msk_1 + 1);
346
+ var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;
347
+ var hsh = function(i3) {
348
+ return (dat[i3] ^ dat[i3 + 1] << bs1_1 ^ dat[i3 + 2] << bs2_1) & msk_1;
349
+ };
350
+ var syms = new i32(25000);
351
+ var lf = new u16(288), df = new u16(32);
352
+ var lc_1 = 0, eb = 0, i2 = st.i || 0, li = 0, wi = st.w || 0, bs = 0;
353
+ for (;i2 + 2 < s; ++i2) {
354
+ var hv = hsh(i2);
355
+ var imod = i2 & 32767, pimod = head[hv];
356
+ prev[imod] = pimod;
357
+ head[hv] = imod;
358
+ if (wi <= i2) {
359
+ var rem = s - i2;
360
+ if ((lc_1 > 7000 || li > 24576) && (rem > 423 || !lst)) {
361
+ pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i2 - bs, pos);
362
+ li = lc_1 = eb = 0, bs = i2;
363
+ for (var j = 0;j < 286; ++j)
364
+ lf[j] = 0;
365
+ for (var j = 0;j < 30; ++j)
366
+ df[j] = 0;
367
+ }
368
+ var l = 2, d = 0, ch_1 = c, dif = imod - pimod & 32767;
369
+ if (rem > 2 && hv == hsh(i2 - dif)) {
370
+ var maxn = Math.min(n, rem) - 1;
371
+ var maxd = Math.min(32767, i2);
372
+ var ml = Math.min(258, rem);
373
+ while (dif <= maxd && --ch_1 && imod != pimod) {
374
+ if (dat[i2 + l] == dat[i2 + l - dif]) {
375
+ var nl = 0;
376
+ for (;nl < ml && dat[i2 + nl] == dat[i2 + nl - dif]; ++nl)
377
+ ;
378
+ if (nl > l) {
379
+ l = nl, d = dif;
380
+ if (nl > maxn)
381
+ break;
382
+ var mmd = Math.min(dif, nl - 2);
383
+ var md = 0;
384
+ for (var j = 0;j < mmd; ++j) {
385
+ var ti = i2 - dif + j & 32767;
386
+ var pti = prev[ti];
387
+ var cd = ti - pti & 32767;
388
+ if (cd > md)
389
+ md = cd, pimod = ti;
390
+ }
391
+ }
392
+ }
393
+ imod = pimod, pimod = prev[imod];
394
+ dif += imod - pimod & 32767;
395
+ }
396
+ }
397
+ if (d) {
398
+ syms[li++] = 268435456 | revfl[l] << 18 | revfd[d];
399
+ var lin = revfl[l] & 31, din = revfd[d] & 31;
400
+ eb += fleb[lin] + fdeb[din];
401
+ ++lf[257 + lin];
402
+ ++df[din];
403
+ wi = i2 + l;
404
+ ++lc_1;
405
+ } else {
406
+ syms[li++] = dat[i2];
407
+ ++lf[dat[i2]];
408
+ }
409
+ }
410
+ }
411
+ for (i2 = Math.max(i2, wi);i2 < s; ++i2) {
412
+ syms[li++] = dat[i2];
413
+ ++lf[dat[i2]];
414
+ }
415
+ pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i2 - bs, pos);
416
+ if (!lst) {
417
+ st.r = pos & 7 | w[pos / 8 | 0] << 3;
418
+ pos -= 7;
419
+ st.h = head, st.p = prev, st.i = i2, st.w = wi;
420
+ }
421
+ } else {
422
+ for (var i2 = st.w || 0;i2 < s + lst; i2 += 65535) {
423
+ var e = i2 + 65535;
424
+ if (e >= s) {
425
+ w[pos / 8 | 0] = lst;
426
+ e = s;
427
+ }
428
+ pos = wfblk(w, pos + 1, dat.subarray(i2, e));
429
+ }
430
+ st.i = s;
431
+ }
432
+ return slc(o, 0, pre + shft(pos) + post);
433
+ };
434
+ var crct = /* @__PURE__ */ function() {
435
+ var t = new Int32Array(256);
436
+ for (var i2 = 0;i2 < 256; ++i2) {
437
+ var c = i2, k = 9;
438
+ while (--k)
439
+ c = (c & 1 && -306674912) ^ c >>> 1;
440
+ t[i2] = c;
441
+ }
442
+ return t;
443
+ }();
444
+ var crc = function() {
445
+ var c = -1;
446
+ return {
447
+ p: function(d) {
448
+ var cr = c;
449
+ for (var i2 = 0;i2 < d.length; ++i2)
450
+ cr = crct[cr & 255 ^ d[i2]] ^ cr >>> 8;
451
+ c = cr;
452
+ },
453
+ d: function() {
454
+ return ~c;
455
+ }
456
+ };
457
+ };
458
+ var dopt = function(dat, opt, pre, post, st) {
459
+ if (!st) {
460
+ st = { l: 1 };
461
+ if (opt.dictionary) {
462
+ var dict = opt.dictionary.subarray(-32768);
463
+ var newDat = new u8(dict.length + dat.length);
464
+ newDat.set(dict);
465
+ newDat.set(dat, dict.length);
466
+ dat = newDat;
467
+ st.w = dict.length;
468
+ }
469
+ }
470
+ return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? st.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : 20 : 12 + opt.mem, pre, post, st);
471
+ };
472
+ var mrg = function(a, b) {
473
+ var o = {};
474
+ for (var k in a)
475
+ o[k] = a[k];
476
+ for (var k in b)
477
+ o[k] = b[k];
478
+ return o;
479
+ };
480
+ var wbytes = function(d, b, v) {
481
+ for (;v; ++b)
482
+ d[b] = v, v >>>= 8;
483
+ };
484
+ function deflateSync(data, opts) {
485
+ return dopt(data, opts || {}, 0, 0);
486
+ }
487
+ var fltn = function(d, p, t, o) {
488
+ for (var k in d) {
489
+ var val = d[k], n = p + k, op = o;
490
+ if (Array.isArray(val))
491
+ op = mrg(o, val[1]), val = val[0];
492
+ if (val instanceof u8)
493
+ t[n] = [val, op];
494
+ else {
495
+ t[n += "/"] = [new u8(0), op];
496
+ fltn(val, n, t, o);
497
+ }
498
+ }
499
+ };
500
+ var te = typeof TextEncoder != "undefined" && /* @__PURE__ */ new TextEncoder;
501
+ var td = typeof TextDecoder != "undefined" && /* @__PURE__ */ new TextDecoder;
502
+ var tds = 0;
503
+ try {
504
+ td.decode(et, { stream: true });
505
+ tds = 1;
506
+ } catch (e) {}
507
+ function strToU8(str, latin1) {
508
+ if (latin1) {
509
+ var ar_1 = new u8(str.length);
510
+ for (var i2 = 0;i2 < str.length; ++i2)
511
+ ar_1[i2] = str.charCodeAt(i2);
512
+ return ar_1;
513
+ }
514
+ if (te)
515
+ return te.encode(str);
516
+ var l = str.length;
517
+ var ar = new u8(str.length + (str.length >> 1));
518
+ var ai = 0;
519
+ var w = function(v) {
520
+ ar[ai++] = v;
521
+ };
522
+ for (var i2 = 0;i2 < l; ++i2) {
523
+ if (ai + 5 > ar.length) {
524
+ var n = new u8(ai + 8 + (l - i2 << 1));
525
+ n.set(ar);
526
+ ar = n;
527
+ }
528
+ var c = str.charCodeAt(i2);
529
+ if (c < 128 || latin1)
530
+ w(c);
531
+ else if (c < 2048)
532
+ w(192 | c >> 6), w(128 | c & 63);
533
+ else if (c > 55295 && c < 57344)
534
+ c = 65536 + (c & 1023 << 10) | str.charCodeAt(++i2) & 1023, w(240 | c >> 18), w(128 | c >> 12 & 63), w(128 | c >> 6 & 63), w(128 | c & 63);
535
+ else
536
+ w(224 | c >> 12), w(128 | c >> 6 & 63), w(128 | c & 63);
537
+ }
538
+ return slc(ar, 0, ai);
539
+ }
540
+ var exfl = function(ex) {
541
+ var le = 0;
542
+ if (ex) {
543
+ for (var k in ex) {
544
+ var l = ex[k].length;
545
+ if (l > 65535)
546
+ err(9);
547
+ le += l + 4;
548
+ }
549
+ }
550
+ return le;
551
+ };
552
+ var wzh = function(d, b, f, fn, u, c, ce, co) {
553
+ var fl2 = fn.length, ex = f.extra, col = co && co.length;
554
+ var exl = exfl(ex);
555
+ wbytes(d, b, ce != null ? 33639248 : 67324752), b += 4;
556
+ if (ce != null)
557
+ d[b++] = 20, d[b++] = f.os;
558
+ d[b] = 20, b += 2;
559
+ d[b++] = f.flag << 1 | (c < 0 && 8), d[b++] = u && 8;
560
+ d[b++] = f.compression & 255, d[b++] = f.compression >> 8;
561
+ var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;
562
+ if (y < 0 || y > 119)
563
+ err(10);
564
+ wbytes(d, b, y << 25 | dt.getMonth() + 1 << 21 | dt.getDate() << 16 | dt.getHours() << 11 | dt.getMinutes() << 5 | dt.getSeconds() >> 1), b += 4;
565
+ if (c != -1) {
566
+ wbytes(d, b, f.crc);
567
+ wbytes(d, b + 4, c < 0 ? -c - 2 : c);
568
+ wbytes(d, b + 8, f.size);
569
+ }
570
+ wbytes(d, b + 12, fl2);
571
+ wbytes(d, b + 14, exl), b += 16;
572
+ if (ce != null) {
573
+ wbytes(d, b, col);
574
+ wbytes(d, b + 6, f.attrs);
575
+ wbytes(d, b + 10, ce), b += 14;
576
+ }
577
+ d.set(fn, b);
578
+ b += fl2;
579
+ if (exl) {
580
+ for (var k in ex) {
581
+ var exf = ex[k], l = exf.length;
582
+ wbytes(d, b, +k);
583
+ wbytes(d, b + 2, l);
584
+ d.set(exf, b + 4), b += 4 + l;
585
+ }
586
+ }
587
+ if (col)
588
+ d.set(co, b), b += col;
589
+ return b;
590
+ };
591
+ var wzf = function(o, b, c, d, e) {
592
+ wbytes(o, b, 101010256);
593
+ wbytes(o, b + 8, c);
594
+ wbytes(o, b + 10, c);
595
+ wbytes(o, b + 12, d);
596
+ wbytes(o, b + 16, e);
597
+ };
598
+ function zipSync(data, opts) {
599
+ if (!opts)
600
+ opts = {};
601
+ var r = {};
602
+ var files = [];
603
+ fltn(data, "", r, opts);
604
+ var o = 0;
605
+ var tot = 0;
606
+ for (var fn in r) {
607
+ var _a2 = r[fn], file = _a2[0], p = _a2[1];
608
+ var compression = p.level == 0 ? 0 : 8;
609
+ var f = strToU8(fn), s = f.length;
610
+ var com = p.comment, m = com && strToU8(com), ms = m && m.length;
611
+ var exl = exfl(p.extra);
612
+ if (s > 65535)
613
+ err(11);
614
+ var d = compression ? deflateSync(file, p) : file, l = d.length;
615
+ var c = crc();
616
+ c.p(file);
617
+ files.push(mrg(p, {
618
+ size: file.length,
619
+ crc: c.d(),
620
+ c: d,
621
+ f,
622
+ m,
623
+ u: s != fn.length || m && com.length != ms,
624
+ o,
625
+ compression
626
+ }));
627
+ o += 30 + s + exl + l;
628
+ tot += 76 + 2 * (s + exl) + (ms || 0) + l;
629
+ }
630
+ var out = new u8(tot + 22), oe = o, cdl = tot - o;
631
+ for (var i2 = 0;i2 < files.length; ++i2) {
632
+ var f = files[i2];
633
+ wzh(out, f.o, f, f.f, f.u, f.c.length);
634
+ var badd = 30 + f.f.length + exfl(f.extra);
635
+ out.set(f.c, f.o + badd);
636
+ wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);
637
+ }
638
+ wzf(out, o, files.length, cdl, oe);
639
+ return out;
640
+ }
641
+
642
+ // ../packager/packager-core/dist/index.js
643
+ class Path {
644
+ static normalize(path) {
645
+ return path.replace(/\\/g, "/").replace(/\/+/g, "/");
646
+ }
647
+ static join(...segments) {
648
+ return Path.normalize(segments.filter((s) => s.length > 0).join("/"));
649
+ }
650
+ static dirname(path) {
651
+ const normalized = Path.normalize(path).replace(/\/$/, "");
652
+ if (normalized === "")
653
+ return ".";
654
+ const lastSlash = normalized.lastIndexOf("/");
655
+ if (lastSlash === -1)
656
+ return ".";
657
+ if (lastSlash === 0)
658
+ return "/";
659
+ return normalized.substring(0, lastSlash);
660
+ }
661
+ static basename(path) {
662
+ const normalized = Path.normalize(path).replace(/\/$/, "");
663
+ if (normalized === "")
664
+ return "";
665
+ const lastSlash = normalized.lastIndexOf("/");
666
+ return lastSlash >= 0 ? normalized.substring(lastSlash + 1) : normalized;
667
+ }
668
+ static extname(path) {
669
+ const base = Path.basename(path);
670
+ const lastDot = base.lastIndexOf(".");
671
+ if (lastDot === -1 || lastDot === 0 || lastDot === base.length - 1) {
672
+ return "";
673
+ }
674
+ return base.substring(lastDot);
675
+ }
676
+ static async walkDirectory(fs, rootPath, currentRelativePath = "") {
677
+ const entries = [];
678
+ const absolutePath = currentRelativePath ? Path.join(rootPath, currentRelativePath) : rootPath;
679
+ const items = await fs.readdir(absolutePath);
680
+ for (const item of items) {
681
+ const itemRelativePath = currentRelativePath ? Path.join(currentRelativePath, item) : item;
682
+ const itemAbsolutePath = Path.join(rootPath, itemRelativePath);
683
+ const stat = await fs.stat(itemAbsolutePath);
684
+ if (stat?.isDirectory()) {
685
+ const subEntries = await Path.walkDirectory(fs, rootPath, itemRelativePath);
686
+ entries.push(...subEntries);
687
+ } else if (stat?.isFile()) {
688
+ entries.push({
689
+ relativePath: Path.normalize(itemRelativePath),
690
+ absolutePath: Path.normalize(itemAbsolutePath)
691
+ });
692
+ }
693
+ }
694
+ return entries;
695
+ }
696
+ }
697
+
698
+ class TemporaryStorageService {
699
+ fileSystem;
700
+ _tempFolderPath = null;
701
+ constructor(fileSystem) {
702
+ this.fileSystem = fileSystem;
703
+ }
704
+ async getTempFolderPath() {
705
+ if (!this._tempFolderPath) {
706
+ const systemTempDir = await this.fileSystem.getTempDir();
707
+ const uniqueFolderName = this.generateUniqueFolderName();
708
+ this._tempFolderPath = Path.join(systemTempDir, uniqueFolderName);
709
+ await this.fileSystem.mkdir(this._tempFolderPath);
710
+ }
711
+ return this._tempFolderPath;
712
+ }
713
+ generateUniqueFolderName() {
714
+ const timestamp = Date.now();
715
+ const random = Math.random().toString(36).substring(2, 10);
716
+ return `tool-temp-${timestamp}-${random}`;
717
+ }
718
+ async getTempSubfolderPathAsync(subfolder) {
719
+ const tempFolderPath = await this.getTempFolderPath();
720
+ const inputPath = Path.join(tempFolderPath, subfolder);
721
+ await this.fileSystem.mkdir(inputPath);
722
+ return inputPath;
723
+ }
724
+ async cleanup() {
725
+ try {
726
+ if (!this._tempFolderPath) {
727
+ return;
728
+ }
729
+ try {
730
+ const stats = await this.fileSystem.stat(this._tempFolderPath);
731
+ if (!stats) {
732
+ return;
733
+ }
734
+ } catch {
735
+ return;
736
+ }
737
+ const pathToCleanup = this._tempFolderPath;
738
+ await this.fileSystem.rm(this._tempFolderPath);
739
+ this._tempFolderPath = null;
740
+ } catch {}
741
+ }
742
+ }
743
+ function isPluralForm(value) {
744
+ return typeof value === "object" && value !== null && "other" in value;
745
+ }
746
+ function selectPluralForm(forms, count) {
747
+ if (count === 0 && forms.zero !== undefined) {
748
+ return forms.zero;
749
+ }
750
+ if (count === 1 && forms.one !== undefined) {
751
+ return forms.one;
752
+ }
753
+ if (count === 2 && forms.two !== undefined) {
754
+ return forms.two;
755
+ }
756
+ if (forms.few !== undefined) {
757
+ const mod10 = count % 10;
758
+ const mod100 = count % 100;
759
+ if (mod10 >= 2 && mod10 <= 4 && (mod100 < 10 || mod100 >= 20)) {
760
+ return forms.few;
761
+ }
762
+ }
763
+ if (forms.many !== undefined) {
764
+ const mod10 = count % 10;
765
+ const mod100 = count % 100;
766
+ if (count === 0 || mod10 === 0 && mod100 !== 0 || mod10 >= 5 && mod10 <= 9 || mod100 >= 11 && mod100 <= 14) {
767
+ return forms.many;
768
+ }
769
+ }
770
+ return forms.other;
771
+ }
772
+
773
+ class I18nManager {
774
+ static translations = {};
775
+ static currentLocale = "en";
776
+ static fallbackLocale = "en";
777
+ static registerTranslations(locale, catalog) {
778
+ if (!I18nManager.translations[locale]) {
779
+ I18nManager.translations[locale] = {};
780
+ }
781
+ I18nManager.translations[locale] = I18nManager.deepMerge(I18nManager.translations[locale], catalog);
782
+ }
783
+ static setLocale(locale) {
784
+ const normalized = I18nManager.normalizeLocale(locale);
785
+ if (I18nManager.translations[normalized]) {
786
+ I18nManager.currentLocale = normalized;
787
+ return normalized;
788
+ }
789
+ const baseLocale = normalized.split("-")[0];
790
+ if (baseLocale !== normalized && I18nManager.translations[baseLocale]) {
791
+ I18nManager.currentLocale = baseLocale;
792
+ return baseLocale;
793
+ }
794
+ return I18nManager.currentLocale;
795
+ }
796
+ static getLocale() {
797
+ return I18nManager.currentLocale;
798
+ }
799
+ static setFallbackLocale(locale) {
800
+ I18nManager.fallbackLocale = I18nManager.normalizeLocale(locale);
801
+ }
802
+ static t(key, params, locale) {
803
+ const targetLocale = locale ? I18nManager.normalizeLocale(locale) : I18nManager.currentLocale;
804
+ let value = I18nManager.getTranslationValue(key, targetLocale);
805
+ if (value === undefined && targetLocale !== I18nManager.fallbackLocale) {
806
+ value = I18nManager.getTranslationValue(key, I18nManager.fallbackLocale);
807
+ }
808
+ if (value === undefined) {
809
+ return key;
810
+ }
811
+ if (isPluralForm(value) && params && "count" in params) {
812
+ const count = typeof params.count === "number" ? params.count : Number(params.count);
813
+ value = selectPluralForm(value, count);
814
+ } else if (isPluralForm(value)) {
815
+ value = value.other;
816
+ }
817
+ if (typeof value !== "string") {
818
+ return key;
819
+ }
820
+ return params ? I18nManager.interpolate(value, params) : value;
821
+ }
822
+ static has(key, locale) {
823
+ const targetLocale = locale ? I18nManager.normalizeLocale(locale) : I18nManager.currentLocale;
824
+ const value = I18nManager.getTranslationValue(key, targetLocale);
825
+ if (value !== undefined) {
826
+ return true;
827
+ }
828
+ if (targetLocale !== I18nManager.fallbackLocale) {
829
+ return I18nManager.getTranslationValue(key, I18nManager.fallbackLocale) !== undefined;
830
+ }
831
+ return false;
832
+ }
833
+ static getAvailableLocales() {
834
+ return Object.keys(I18nManager.translations);
835
+ }
836
+ static clearTranslations() {
837
+ I18nManager.translations = {};
838
+ I18nManager.currentLocale = "en";
839
+ }
840
+ static getTranslationValue(key, locale) {
841
+ const catalog = I18nManager.translations[locale];
842
+ if (!catalog) {
843
+ return;
844
+ }
845
+ const keys = key.split(".");
846
+ let value = catalog;
847
+ for (const k of keys) {
848
+ if (value && typeof value === "object" && k in value) {
849
+ value = value[k];
850
+ } else {
851
+ return;
852
+ }
853
+ }
854
+ return value;
855
+ }
856
+ static interpolate(template, params) {
857
+ return template.replace(/\{(\w+)\}/g, (_, key) => {
858
+ const value = params[key];
859
+ return value !== undefined ? String(value) : `{${key}}`;
860
+ });
861
+ }
862
+ static normalizeLocale(locale) {
863
+ const normalized = locale.toLowerCase().replace(/_/g, "-");
864
+ const specialLocales = ["es-mx", "pt-br", "zh-cn", "zh-tw"];
865
+ if (specialLocales.includes(normalized)) {
866
+ return normalized;
867
+ }
868
+ return normalized.split("-")[0];
869
+ }
870
+ static deepMerge(target, source) {
871
+ const result = { ...target };
872
+ for (const key of Object.keys(source)) {
873
+ const sourceValue = source[key];
874
+ const targetValue = result[key];
875
+ if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue) && targetValue && typeof targetValue === "object" && !Array.isArray(targetValue)) {
876
+ result[key] = I18nManager.deepMerge(targetValue, sourceValue);
877
+ } else {
878
+ result[key] = sourceValue;
879
+ }
880
+ }
881
+ return result;
882
+ }
883
+ }
884
+ var de = {
885
+ toolCore: {
886
+ errors: {
887
+ internal: "Internal error: {message}",
888
+ fileNotFound: "File not found: {path}",
889
+ fileReadFailed: "Failed to read file: {path}",
890
+ fileWriteFailed: "Failed to write file: {path}",
891
+ directoryNotFound: "Directory not found: {path}",
892
+ invalidPath: "{path} is not a valid path",
893
+ operationCanceled: "Operation was canceled",
894
+ invalidParameter: "Invalid parameter: {parameter}"
895
+ },
896
+ progress: {
897
+ copying: "Copying files...",
898
+ building: "Building project...",
899
+ packaging: "Creating package...",
900
+ validating: "Validating...",
901
+ analyzing: "Analyzing...",
902
+ restoring: "Restoring dependencies..."
903
+ },
904
+ validation: {
905
+ requiredField: "{field} is required",
906
+ invalidValue: "Invalid value for {field}",
907
+ pathNotFound: "Path not found: {path}",
908
+ fileRequired: "File is required: {path}",
909
+ directoryRequired: "Directory is required: {path}"
910
+ },
911
+ warnings: {
912
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
913
+ },
914
+ info: {
915
+ operationComplete: "Operation completed successfully",
916
+ filesProcessed: {
917
+ zero: "No files processed",
918
+ one: "{count} file processed",
919
+ other: "{count} files processed"
920
+ }
921
+ }
922
+ }
923
+ };
924
+ var en = {
925
+ toolCore: {
926
+ errors: {
927
+ internal: "Internal error: {message}",
928
+ fileNotFound: "File not found: {path}",
929
+ fileReadFailed: "Failed to read file: {path}",
930
+ fileWriteFailed: "Failed to write file: {path}",
931
+ directoryNotFound: "Directory not found: {path}",
932
+ invalidPath: "{path} is not a valid path",
933
+ operationCanceled: "Operation was canceled",
934
+ invalidParameter: "Invalid parameter: {parameter}"
935
+ },
936
+ progress: {
937
+ copying: "Copying files...",
938
+ building: "Building project...",
939
+ packaging: "Creating package...",
940
+ validating: "Validating...",
941
+ analyzing: "Analyzing...",
942
+ restoring: "Restoring dependencies..."
943
+ },
944
+ validation: {
945
+ requiredField: "{field} is required",
946
+ invalidValue: "Invalid value for {field}",
947
+ pathNotFound: "Path not found: {path}",
948
+ fileRequired: "File is required: {path}",
949
+ directoryRequired: "Directory is required: {path}"
950
+ },
951
+ warnings: {
952
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
953
+ },
954
+ info: {
955
+ operationComplete: "Operation completed successfully",
956
+ filesProcessed: {
957
+ zero: "No files processed",
958
+ one: "{count} file processed",
959
+ other: "{count} files processed"
960
+ }
961
+ }
962
+ }
963
+ };
964
+ var es = {
965
+ toolCore: {
966
+ errors: {
967
+ internal: "Internal error: {message}",
968
+ fileNotFound: "File not found: {path}",
969
+ fileReadFailed: "Failed to read file: {path}",
970
+ fileWriteFailed: "Failed to write file: {path}",
971
+ directoryNotFound: "Directory not found: {path}",
972
+ invalidPath: "{path} is not a valid path",
973
+ operationCanceled: "Operation was canceled",
974
+ invalidParameter: "Invalid parameter: {parameter}"
975
+ },
976
+ progress: {
977
+ copying: "Copying files...",
978
+ building: "Building project...",
979
+ packaging: "Creating package...",
980
+ validating: "Validating...",
981
+ analyzing: "Analyzing...",
982
+ restoring: "Restoring dependencies..."
983
+ },
984
+ validation: {
985
+ requiredField: "{field} is required",
986
+ invalidValue: "Invalid value for {field}",
987
+ pathNotFound: "Path not found: {path}",
988
+ fileRequired: "File is required: {path}",
989
+ directoryRequired: "Directory is required: {path}"
990
+ },
991
+ warnings: {
992
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
993
+ },
994
+ info: {
995
+ operationComplete: "Operation completed successfully",
996
+ filesProcessed: {
997
+ zero: "No files processed",
998
+ one: "{count} file processed",
999
+ other: "{count} files processed"
1000
+ }
1001
+ }
1002
+ }
1003
+ };
1004
+ var es_MX = {
1005
+ toolCore: {
1006
+ errors: {
1007
+ internal: "Internal error: {message}",
1008
+ fileNotFound: "File not found: {path}",
1009
+ fileReadFailed: "Failed to read file: {path}",
1010
+ fileWriteFailed: "Failed to write file: {path}",
1011
+ directoryNotFound: "Directory not found: {path}",
1012
+ invalidPath: "{path} is not a valid path",
1013
+ operationCanceled: "Operation was canceled",
1014
+ invalidParameter: "Invalid parameter: {parameter}"
1015
+ },
1016
+ progress: {
1017
+ copying: "Copying files...",
1018
+ building: "Building project...",
1019
+ packaging: "Creating package...",
1020
+ validating: "Validating...",
1021
+ analyzing: "Analyzing...",
1022
+ restoring: "Restoring dependencies..."
1023
+ },
1024
+ validation: {
1025
+ requiredField: "{field} is required",
1026
+ invalidValue: "Invalid value for {field}",
1027
+ pathNotFound: "Path not found: {path}",
1028
+ fileRequired: "File is required: {path}",
1029
+ directoryRequired: "Directory is required: {path}"
1030
+ },
1031
+ warnings: {
1032
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
1033
+ },
1034
+ info: {
1035
+ operationComplete: "Operation completed successfully",
1036
+ filesProcessed: {
1037
+ zero: "No files processed",
1038
+ one: "{count} file processed",
1039
+ other: "{count} files processed"
1040
+ }
1041
+ }
1042
+ }
1043
+ };
1044
+ var fr = {
1045
+ toolCore: {
1046
+ errors: {
1047
+ internal: "Internal error: {message}",
1048
+ fileNotFound: "File not found: {path}",
1049
+ fileReadFailed: "Failed to read file: {path}",
1050
+ fileWriteFailed: "Failed to write file: {path}",
1051
+ directoryNotFound: "Directory not found: {path}",
1052
+ invalidPath: "{path} is not a valid path",
1053
+ operationCanceled: "Operation was canceled",
1054
+ invalidParameter: "Invalid parameter: {parameter}"
1055
+ },
1056
+ progress: {
1057
+ copying: "Copying files...",
1058
+ building: "Building project...",
1059
+ packaging: "Creating package...",
1060
+ validating: "Validating...",
1061
+ analyzing: "Analyzing...",
1062
+ restoring: "Restoring dependencies..."
1063
+ },
1064
+ validation: {
1065
+ requiredField: "{field} is required",
1066
+ invalidValue: "Invalid value for {field}",
1067
+ pathNotFound: "Path not found: {path}",
1068
+ fileRequired: "File is required: {path}",
1069
+ directoryRequired: "Directory is required: {path}"
1070
+ },
1071
+ warnings: {
1072
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
1073
+ },
1074
+ info: {
1075
+ operationComplete: "Operation completed successfully",
1076
+ filesProcessed: {
1077
+ zero: "No files processed",
1078
+ one: "{count} file processed",
1079
+ other: "{count} files processed"
1080
+ }
1081
+ }
1082
+ }
1083
+ };
1084
+ var ja = {
1085
+ toolCore: {
1086
+ errors: {
1087
+ internal: "Internal error: {message}",
1088
+ fileNotFound: "File not found: {path}",
1089
+ fileReadFailed: "Failed to read file: {path}",
1090
+ fileWriteFailed: "Failed to write file: {path}",
1091
+ directoryNotFound: "Directory not found: {path}",
1092
+ invalidPath: "{path} is not a valid path",
1093
+ operationCanceled: "Operation was canceled",
1094
+ invalidParameter: "Invalid parameter: {parameter}"
1095
+ },
1096
+ progress: {
1097
+ copying: "Copying files...",
1098
+ building: "Building project...",
1099
+ packaging: "Creating package...",
1100
+ validating: "Validating...",
1101
+ analyzing: "Analyzing...",
1102
+ restoring: "Restoring dependencies..."
1103
+ },
1104
+ validation: {
1105
+ requiredField: "{field} is required",
1106
+ invalidValue: "Invalid value for {field}",
1107
+ pathNotFound: "Path not found: {path}",
1108
+ fileRequired: "File is required: {path}",
1109
+ directoryRequired: "Directory is required: {path}"
1110
+ },
1111
+ warnings: {
1112
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
1113
+ },
1114
+ info: {
1115
+ operationComplete: "Operation completed successfully",
1116
+ filesProcessed: {
1117
+ zero: "No files processed",
1118
+ one: "{count} file processed",
1119
+ other: "{count} files processed"
1120
+ }
1121
+ }
1122
+ }
1123
+ };
1124
+ var ko = {
1125
+ toolCore: {
1126
+ errors: {
1127
+ internal: "Internal error: {message}",
1128
+ fileNotFound: "File not found: {path}",
1129
+ fileReadFailed: "Failed to read file: {path}",
1130
+ fileWriteFailed: "Failed to write file: {path}",
1131
+ directoryNotFound: "Directory not found: {path}",
1132
+ invalidPath: "{path} is not a valid path",
1133
+ operationCanceled: "Operation was canceled",
1134
+ invalidParameter: "Invalid parameter: {parameter}"
1135
+ },
1136
+ progress: {
1137
+ copying: "Copying files...",
1138
+ building: "Building project...",
1139
+ packaging: "Creating package...",
1140
+ validating: "Validating...",
1141
+ analyzing: "Analyzing...",
1142
+ restoring: "Restoring dependencies..."
1143
+ },
1144
+ validation: {
1145
+ requiredField: "{field} is required",
1146
+ invalidValue: "Invalid value for {field}",
1147
+ pathNotFound: "Path not found: {path}",
1148
+ fileRequired: "File is required: {path}",
1149
+ directoryRequired: "Directory is required: {path}"
1150
+ },
1151
+ warnings: {
1152
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
1153
+ },
1154
+ info: {
1155
+ operationComplete: "Operation completed successfully",
1156
+ filesProcessed: {
1157
+ zero: "No files processed",
1158
+ one: "{count} file processed",
1159
+ other: "{count} files processed"
1160
+ }
1161
+ }
1162
+ }
1163
+ };
1164
+ var pt = {
1165
+ toolCore: {
1166
+ errors: {
1167
+ internal: "Internal error: {message}",
1168
+ fileNotFound: "File not found: {path}",
1169
+ fileReadFailed: "Failed to read file: {path}",
1170
+ fileWriteFailed: "Failed to write file: {path}",
1171
+ directoryNotFound: "Directory not found: {path}",
1172
+ invalidPath: "{path} is not a valid path",
1173
+ operationCanceled: "Operation was canceled",
1174
+ invalidParameter: "Invalid parameter: {parameter}"
1175
+ },
1176
+ progress: {
1177
+ copying: "Copying files...",
1178
+ building: "Building project...",
1179
+ packaging: "Creating package...",
1180
+ validating: "Validating...",
1181
+ analyzing: "Analyzing...",
1182
+ restoring: "Restoring dependencies..."
1183
+ },
1184
+ validation: {
1185
+ requiredField: "{field} is required",
1186
+ invalidValue: "Invalid value for {field}",
1187
+ pathNotFound: "Path not found: {path}",
1188
+ fileRequired: "File is required: {path}",
1189
+ directoryRequired: "Directory is required: {path}"
1190
+ },
1191
+ warnings: {
1192
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
1193
+ },
1194
+ info: {
1195
+ operationComplete: "Operation completed successfully",
1196
+ filesProcessed: {
1197
+ zero: "No files processed",
1198
+ one: "{count} file processed",
1199
+ other: "{count} files processed"
1200
+ }
1201
+ }
1202
+ }
1203
+ };
1204
+ var pt_BR = {
1205
+ toolCore: {
1206
+ errors: {
1207
+ internal: "Internal error: {message}",
1208
+ fileNotFound: "File not found: {path}",
1209
+ fileReadFailed: "Failed to read file: {path}",
1210
+ fileWriteFailed: "Failed to write file: {path}",
1211
+ directoryNotFound: "Directory not found: {path}",
1212
+ invalidPath: "{path} is not a valid path",
1213
+ operationCanceled: "Operation was canceled",
1214
+ invalidParameter: "Invalid parameter: {parameter}"
1215
+ },
1216
+ progress: {
1217
+ copying: "Copying files...",
1218
+ building: "Building project...",
1219
+ packaging: "Creating package...",
1220
+ validating: "Validating...",
1221
+ analyzing: "Analyzing...",
1222
+ restoring: "Restoring dependencies..."
1223
+ },
1224
+ validation: {
1225
+ requiredField: "{field} is required",
1226
+ invalidValue: "Invalid value for {field}",
1227
+ pathNotFound: "Path not found: {path}",
1228
+ fileRequired: "File is required: {path}",
1229
+ directoryRequired: "Directory is required: {path}"
1230
+ },
1231
+ warnings: {
1232
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
1233
+ },
1234
+ info: {
1235
+ operationComplete: "Operation completed successfully",
1236
+ filesProcessed: {
1237
+ zero: "No files processed",
1238
+ one: "{count} file processed",
1239
+ other: "{count} files processed"
1240
+ }
1241
+ }
1242
+ }
1243
+ };
1244
+ var ro = {
1245
+ toolCore: {
1246
+ errors: {
1247
+ internal: "Internal error: {message}",
1248
+ fileNotFound: "File not found: {path}",
1249
+ fileReadFailed: "Failed to read file: {path}",
1250
+ fileWriteFailed: "Failed to write file: {path}",
1251
+ directoryNotFound: "Directory not found: {path}",
1252
+ invalidPath: "{path} is not a valid path",
1253
+ operationCanceled: "Operation was canceled",
1254
+ invalidParameter: "Invalid parameter: {parameter}"
1255
+ },
1256
+ progress: {
1257
+ copying: "Copying files...",
1258
+ building: "Building project...",
1259
+ packaging: "Creating package...",
1260
+ validating: "Validating...",
1261
+ analyzing: "Analyzing...",
1262
+ restoring: "Restoring dependencies..."
1263
+ },
1264
+ validation: {
1265
+ requiredField: "{field} is required",
1266
+ invalidValue: "Invalid value for {field}",
1267
+ pathNotFound: "Path not found: {path}",
1268
+ fileRequired: "File is required: {path}",
1269
+ directoryRequired: "Directory is required: {path}"
1270
+ },
1271
+ warnings: {
1272
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
1273
+ },
1274
+ info: {
1275
+ operationComplete: "Operation completed successfully",
1276
+ filesProcessed: {
1277
+ zero: "No files processed",
1278
+ one: "{count} file processed",
1279
+ other: "{count} files processed"
1280
+ }
1281
+ }
1282
+ }
1283
+ };
1284
+ var ru = {
1285
+ toolCore: {
1286
+ errors: {
1287
+ internal: "Internal error: {message}",
1288
+ fileNotFound: "File not found: {path}",
1289
+ fileReadFailed: "Failed to read file: {path}",
1290
+ fileWriteFailed: "Failed to write file: {path}",
1291
+ directoryNotFound: "Directory not found: {path}",
1292
+ invalidPath: "{path} is not a valid path",
1293
+ operationCanceled: "Operation was canceled",
1294
+ invalidParameter: "Invalid parameter: {parameter}"
1295
+ },
1296
+ progress: {
1297
+ copying: "Copying files...",
1298
+ building: "Building project...",
1299
+ packaging: "Creating package...",
1300
+ validating: "Validating...",
1301
+ analyzing: "Analyzing...",
1302
+ restoring: "Restoring dependencies..."
1303
+ },
1304
+ validation: {
1305
+ requiredField: "{field} is required",
1306
+ invalidValue: "Invalid value for {field}",
1307
+ pathNotFound: "Path not found: {path}",
1308
+ fileRequired: "File is required: {path}",
1309
+ directoryRequired: "Directory is required: {path}"
1310
+ },
1311
+ warnings: {
1312
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
1313
+ },
1314
+ info: {
1315
+ operationComplete: "Operation completed successfully",
1316
+ filesProcessed: {
1317
+ zero: "No files processed",
1318
+ one: "{count} file processed",
1319
+ other: "{count} files processed"
1320
+ }
1321
+ }
1322
+ }
1323
+ };
1324
+ var tr = {
1325
+ toolCore: {
1326
+ errors: {
1327
+ internal: "Internal error: {message}",
1328
+ fileNotFound: "File not found: {path}",
1329
+ fileReadFailed: "Failed to read file: {path}",
1330
+ fileWriteFailed: "Failed to write file: {path}",
1331
+ directoryNotFound: "Directory not found: {path}",
1332
+ invalidPath: "{path} is not a valid path",
1333
+ operationCanceled: "Operation was canceled",
1334
+ invalidParameter: "Invalid parameter: {parameter}"
1335
+ },
1336
+ progress: {
1337
+ copying: "Copying files...",
1338
+ building: "Building project...",
1339
+ packaging: "Creating package...",
1340
+ validating: "Validating...",
1341
+ analyzing: "Analyzing...",
1342
+ restoring: "Restoring dependencies..."
1343
+ },
1344
+ validation: {
1345
+ requiredField: "{field} is required",
1346
+ invalidValue: "Invalid value for {field}",
1347
+ pathNotFound: "Path not found: {path}",
1348
+ fileRequired: "File is required: {path}",
1349
+ directoryRequired: "Directory is required: {path}"
1350
+ },
1351
+ warnings: {
1352
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
1353
+ },
1354
+ info: {
1355
+ operationComplete: "Operation completed successfully",
1356
+ filesProcessed: {
1357
+ zero: "No files processed",
1358
+ one: "{count} file processed",
1359
+ other: "{count} files processed"
1360
+ }
1361
+ }
1362
+ }
1363
+ };
1364
+ var zh_CN = {
1365
+ toolCore: {
1366
+ errors: {
1367
+ internal: "Internal error: {message}",
1368
+ fileNotFound: "File not found: {path}",
1369
+ fileReadFailed: "Failed to read file: {path}",
1370
+ fileWriteFailed: "Failed to write file: {path}",
1371
+ directoryNotFound: "Directory not found: {path}",
1372
+ invalidPath: "{path} is not a valid path",
1373
+ operationCanceled: "Operation was canceled",
1374
+ invalidParameter: "Invalid parameter: {parameter}"
1375
+ },
1376
+ progress: {
1377
+ copying: "Copying files...",
1378
+ building: "Building project...",
1379
+ packaging: "Creating package...",
1380
+ validating: "Validating...",
1381
+ analyzing: "Analyzing...",
1382
+ restoring: "Restoring dependencies..."
1383
+ },
1384
+ validation: {
1385
+ requiredField: "{field} is required",
1386
+ invalidValue: "Invalid value for {field}",
1387
+ pathNotFound: "Path not found: {path}",
1388
+ fileRequired: "File is required: {path}",
1389
+ directoryRequired: "Directory is required: {path}"
1390
+ },
1391
+ warnings: {
1392
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
1393
+ },
1394
+ info: {
1395
+ operationComplete: "Operation completed successfully",
1396
+ filesProcessed: {
1397
+ zero: "No files processed",
1398
+ one: "{count} file processed",
1399
+ other: "{count} files processed"
1400
+ }
1401
+ }
1402
+ }
1403
+ };
1404
+ var zh_TW = {
1405
+ toolCore: {
1406
+ errors: {
1407
+ internal: "Internal error: {message}",
1408
+ fileNotFound: "File not found: {path}",
1409
+ fileReadFailed: "Failed to read file: {path}",
1410
+ fileWriteFailed: "Failed to write file: {path}",
1411
+ directoryNotFound: "Directory not found: {path}",
1412
+ invalidPath: "{path} is not a valid path",
1413
+ operationCanceled: "Operation was canceled",
1414
+ invalidParameter: "Invalid parameter: {parameter}"
1415
+ },
1416
+ progress: {
1417
+ copying: "Copying files...",
1418
+ building: "Building project...",
1419
+ packaging: "Creating package...",
1420
+ validating: "Validating...",
1421
+ analyzing: "Analyzing...",
1422
+ restoring: "Restoring dependencies..."
1423
+ },
1424
+ validation: {
1425
+ requiredField: "{field} is required",
1426
+ invalidValue: "Invalid value for {field}",
1427
+ pathNotFound: "Path not found: {path}",
1428
+ fileRequired: "File is required: {path}",
1429
+ directoryRequired: "Directory is required: {path}"
1430
+ },
1431
+ warnings: {
1432
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
1433
+ },
1434
+ info: {
1435
+ operationComplete: "Operation completed successfully",
1436
+ filesProcessed: {
1437
+ zero: "No files processed",
1438
+ one: "{count} file processed",
1439
+ other: "{count} files processed"
1440
+ }
1441
+ }
1442
+ }
1443
+ };
1444
+ var zu = {
1445
+ toolCore: {
1446
+ errors: {
1447
+ internal: "Internal error: {message}",
1448
+ fileNotFound: "File not found: {path}",
1449
+ fileReadFailed: "Failed to read file: {path}",
1450
+ fileWriteFailed: "Failed to write file: {path}",
1451
+ directoryNotFound: "Directory not found: {path}",
1452
+ invalidPath: "{path} is not a valid path",
1453
+ operationCanceled: "Operation was canceled",
1454
+ invalidParameter: "Invalid parameter: {parameter}"
1455
+ },
1456
+ progress: {
1457
+ copying: "Copying files...",
1458
+ building: "Building project...",
1459
+ packaging: "Creating package...",
1460
+ validating: "Validating...",
1461
+ analyzing: "Analyzing...",
1462
+ restoring: "Restoring dependencies..."
1463
+ },
1464
+ validation: {
1465
+ requiredField: "{field} is required",
1466
+ invalidValue: "Invalid value for {field}",
1467
+ pathNotFound: "Path not found: {path}",
1468
+ fileRequired: "File is required: {path}",
1469
+ directoryRequired: "Directory is required: {path}"
1470
+ },
1471
+ warnings: {
1472
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
1473
+ },
1474
+ info: {
1475
+ operationComplete: "Operation completed successfully",
1476
+ filesProcessed: {
1477
+ zero: "No files processed",
1478
+ one: "{count} file processed",
1479
+ other: "{count} files processed"
1480
+ }
1481
+ }
1482
+ }
1483
+ };
1484
+
1485
+ class TranslationService {
1486
+ static instance;
1487
+ currentLocale = "en";
1488
+ constructor() {}
1489
+ static getInstance() {
1490
+ if (!TranslationService.instance) {
1491
+ TranslationService.instance = new TranslationService;
1492
+ }
1493
+ return TranslationService.instance;
1494
+ }
1495
+ setLocale(locale) {
1496
+ this.currentLocale = I18nManager.setLocale(locale);
1497
+ }
1498
+ getLocale() {
1499
+ return this.currentLocale;
1500
+ }
1501
+ t(key, params) {
1502
+ return I18nManager.t(key, params, this.currentLocale);
1503
+ }
1504
+ tLocale(key, locale, params) {
1505
+ return I18nManager.t(key, params, locale);
1506
+ }
1507
+ has(key) {
1508
+ return I18nManager.has(key, this.currentLocale);
1509
+ }
1510
+ getAvailableLocales() {
1511
+ return I18nManager.getAvailableLocales();
1512
+ }
1513
+ }
1514
+ var translate = TranslationService.getInstance();
1515
+ I18nManager.registerTranslations("en", en);
1516
+ I18nManager.registerTranslations("de", de);
1517
+ I18nManager.registerTranslations("es", es);
1518
+ I18nManager.registerTranslations("es-mx", es_MX);
1519
+ I18nManager.registerTranslations("fr", fr);
1520
+ I18nManager.registerTranslations("ja", ja);
1521
+ I18nManager.registerTranslations("ko", ko);
1522
+ I18nManager.registerTranslations("pt", pt);
1523
+ I18nManager.registerTranslations("pt-br", pt_BR);
1524
+ I18nManager.registerTranslations("ro", ro);
1525
+ I18nManager.registerTranslations("ru", ru);
1526
+ I18nManager.registerTranslations("tr", tr);
1527
+ I18nManager.registerTranslations("zh-cn", zh_CN);
1528
+ I18nManager.registerTranslations("zh-tw", zh_TW);
1529
+ I18nManager.registerTranslations("zu", zu);
1530
+ I18nManager.setLocale("en");
1531
+ var BuildConfiguration;
1532
+ ((BuildConfiguration2) => {
1533
+ BuildConfiguration2["Debug"] = "Debug";
1534
+ BuildConfiguration2["Release"] = "Release";
1535
+ })(BuildConfiguration ||= {});
1536
+ var LogLevel;
1537
+ ((LogLevel2) => {
1538
+ LogLevel2["Debug"] = "Debug";
1539
+ LogLevel2["Info"] = "Information";
1540
+ LogLevel2["Warn"] = "Warning";
1541
+ LogLevel2["Error"] = "Error";
1542
+ })(LogLevel ||= {});
1543
+ var NugetConstants = {
1544
+ OutputFolderName: "bundle",
1545
+ ContentFolderName: "content",
1546
+ OperateFileName: "operate.json",
1547
+ EntryPointsFileName: "entry-points.json",
1548
+ PackageDescriptorFileName: "package-descriptor.json",
1549
+ BindingsV2FileName: "bindings_v2.json",
1550
+ BindingsFileId: "bindings.json"
1551
+ };
1552
+ var ProjectTypes;
1553
+ ((ProjectTypes2) => {
1554
+ ProjectTypes2["Agent"] = "Agent";
1555
+ ProjectTypes2["Api"] = "Api";
1556
+ ProjectTypes2["Connector"] = "Connector";
1557
+ ProjectTypes2["CaseManagement"] = "CaseManagement";
1558
+ ProjectTypes2["Flow"] = "Flow";
1559
+ ProjectTypes2["Function"] = "Function";
1560
+ ProjectTypes2["ProcessOrchestration"] = "ProcessOrchestration";
1561
+ ProjectTypes2["Process"] = "Process";
1562
+ ProjectTypes2["Library"] = "Library";
1563
+ ProjectTypes2["WebApp"] = "WebApp";
1564
+ ProjectTypes2["Tests"] = "Tests";
1565
+ ProjectTypes2["AppV2"] = "AppV2";
1566
+ })(ProjectTypes ||= {});
1567
+ var TargetFramework;
1568
+ ((TargetFramework2) => {
1569
+ TargetFramework2["Portable"] = "Portable";
1570
+ TargetFramework2["Windows"] = "Windows";
1571
+ })(TargetFramework ||= {});
1572
+ var ToolErrorCodes;
1573
+ ((ToolErrorCodes2) => {
1574
+ ToolErrorCodes2["Success"] = "SUCCESS";
1575
+ ToolErrorCodes2["InternalError"] = "INTERNAL_ERROR";
1576
+ ToolErrorCodes2["Canceled"] = "CANCELED";
1577
+ })(ToolErrorCodes ||= {});
1578
+
1579
+ class ToolResult {
1580
+ errorCode;
1581
+ message;
1582
+ packages;
1583
+ constructor(errorCode, message, packages = []) {
1584
+ this.errorCode = errorCode;
1585
+ this.message = message;
1586
+ this.packages = packages;
1587
+ }
1588
+ get isSuccess() {
1589
+ return this.errorCode === "SUCCESS";
1590
+ }
1591
+ static success() {
1592
+ return new ToolResult("SUCCESS");
1593
+ }
1594
+ static error(errorCode, message) {
1595
+ return new ToolResult(errorCode, message);
1596
+ }
1597
+ }
1598
+ function escapeXml(str) {
1599
+ if (str === null || str === undefined) {
1600
+ return "";
1601
+ }
1602
+ return String(str).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
1603
+ }
1604
+ function optionalElement(name, value) {
1605
+ if (value === undefined || value === "")
1606
+ return "";
1607
+ return ` <${name}>${escapeXml(value)}</${name}>
1608
+ `;
1609
+ }
1610
+ function generateDependenciesXml(dependencies) {
1611
+ if (!dependencies || dependencies.length === 0)
1612
+ return "";
1613
+ const deps = dependencies.map((d) => ` <dependency id="${escapeXml(d.id)}" version="${escapeXml(d.version)}" />`).join(`
1614
+ `);
1615
+ return ` <dependencies>
1616
+ ${deps}
1617
+ </dependencies>
1618
+ `;
1619
+ }
1620
+ function generateRepositoryXml(packageInfo) {
1621
+ if (!packageInfo.repositoryType || !packageInfo.repositoryUrl)
1622
+ return "";
1623
+ let repoXml = ` <repository type="${escapeXml(packageInfo.repositoryType)}" url="${escapeXml(packageInfo.repositoryUrl)}"`;
1624
+ if (packageInfo.repositoryBranch) {
1625
+ repoXml += ` branch="${escapeXml(packageInfo.repositoryBranch)}"`;
1626
+ }
1627
+ if (packageInfo.repositoryCommit) {
1628
+ repoXml += ` commit="${escapeXml(packageInfo.repositoryCommit)}"`;
1629
+ }
1630
+ repoXml += ` />
1631
+ `;
1632
+ return repoXml;
1633
+ }
1634
+ function generateNuspecXml(packageInfo) {
1635
+ const author = packageInfo.author?.trim() || "UiPath";
1636
+ const description = packageInfo.description?.trim() || "Created by UiPath";
1637
+ const title = packageInfo.title?.trim() || packageInfo.id;
1638
+ const requireLicenseAcceptance = packageInfo.requireLicenseAcceptance === true ? "true" : "false";
1639
+ const releaseNotes = packageInfo.releaseNotes ?? "";
1640
+ const xml = `\uFEFF<?xml version="1.0" encoding="utf-8"?>
1641
+ <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
1642
+ <metadata>
1643
+ <id>${escapeXml(packageInfo.id)}</id>
1644
+ <version>${escapeXml(packageInfo.version)}</version>
1645
+ <title>${escapeXml(title)}</title>
1646
+ <authors>${escapeXml(author)}</authors>
1647
+ <requireLicenseAcceptance>${requireLicenseAcceptance}</requireLicenseAcceptance>
1648
+ <description>${escapeXml(description)}</description>
1649
+ <releaseNotes>${escapeXml(releaseNotes)}</releaseNotes>
1650
+ ${optionalElement("tags", packageInfo.tags)}${optionalElement("iconUrl", packageInfo.iconUrl)}${optionalElement("projectUrl", packageInfo.projectUrl)}${optionalElement("licenseUrl", packageInfo.licenseUrl)}${optionalElement("copyright", packageInfo.copyright)}${generateRepositoryXml(packageInfo)}${generateDependenciesXml(packageInfo.dependencies)} </metadata>
1651
+ </package>
1652
+ `;
1653
+ return xml;
1654
+ }
1655
+ function generatePsmdcpXml(packageInfo) {
1656
+ const author = packageInfo.author?.trim() || "UiPath";
1657
+ const description = packageInfo.description?.trim() || "Created by UiPath";
1658
+ return `<?xml version="1.0" encoding="utf-8"?>
1659
+ <coreProperties xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.openxmlformats.org/package/2006/metadata/core-properties">
1660
+ <dc:creator>${escapeXml(author)}</dc:creator>
1661
+ <dc:description>${escapeXml(description)}</dc:description>
1662
+ <dc:identifier>${escapeXml(packageInfo.id)}</dc:identifier>
1663
+ <version>${escapeXml(packageInfo.version)}</version>
1664
+ <keywords></keywords>
1665
+ <lastModifiedBy>NuGet.Packaging, Version=6.12.1.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35;.NET 5.0</lastModifiedBy>
1666
+ </coreProperties>`;
1667
+ }
1668
+
1669
+ class NugetPackager {
1670
+ fileSystem;
1671
+ constructor(fileSystem) {
1672
+ this.fileSystem = fileSystem;
1673
+ }
1674
+ async packAsync(rootPath, packageInfo, outputPath) {
1675
+ const normalizedOutputPath = Path.normalize(outputPath);
1676
+ const nuspecXml = generateNuspecXml(packageInfo);
1677
+ const nuspecFileName = `${packageInfo.id}.nuspec`;
1678
+ const fileEntries = await Path.walkDirectory(this.fileSystem, rootPath);
1679
+ const zipContents = {};
1680
+ const encoder = new TextEncoder;
1681
+ const psmdcpId = Array.from({ length: 4 }, () => Math.floor(Math.random() * 4294967296).toString(16).padStart(8, "0")).join("");
1682
+ const psmdcpFileName = `${psmdcpId}.psmdcp`;
1683
+ const psmdcpPath = `package/services/metadata/core-properties/${psmdcpFileName}`;
1684
+ const contentTypesXml = `<?xml version="1.0" encoding="utf-8"?>
1685
+ <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
1686
+ <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" />
1687
+ <Default Extension="psmdcp" ContentType="application/vnd.openxmlformats-package.core-properties+xml" />
1688
+ <Default Extension="uiproj" ContentType="application/octet" />
1689
+ <Default Extension="json" ContentType="application/octet" />
1690
+ <Default Extension="nuspec" ContentType="application/octet" />
1691
+ </Types>`;
1692
+ zipContents["[Content_Types].xml"] = encoder.encode(contentTypesXml);
1693
+ const manifestRelId = `R${Date.now().toString(16).toUpperCase()}`;
1694
+ const corePropsRelId = `R${(Date.now() + 1).toString(16).toUpperCase()}`;
1695
+ const relsXml = `<?xml version="1.0" encoding="utf-8"?>
1696
+ <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
1697
+ <Relationship Type="http://schemas.microsoft.com/packaging/2010/07/manifest" Target="/${nuspecFileName}" Id="${manifestRelId}" />
1698
+ <Relationship Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="/${psmdcpPath}" Id="${corePropsRelId}" />
1699
+ </Relationships>`;
1700
+ zipContents["_rels/.rels"] = encoder.encode(relsXml);
1701
+ zipContents[psmdcpPath] = encoder.encode(generatePsmdcpXml(packageInfo));
1702
+ zipContents[nuspecFileName] = encoder.encode(nuspecXml);
1703
+ for (const entry of fileEntries) {
1704
+ const content = await this.fileSystem.readFile(entry.absolutePath);
1705
+ if (content !== null) {
1706
+ zipContents[entry.relativePath] = content;
1707
+ }
1708
+ }
1709
+ const zippedData = zipSync(zipContents);
1710
+ await this.fileSystem.writeFile(normalizedOutputPath, zippedData);
1711
+ return {
1712
+ outputPath: normalizedOutputPath
1713
+ };
1714
+ }
1715
+ }
1716
+
1717
+ class ProjectTool {
1718
+ fileSystem;
1719
+ logger;
1720
+ static ProjectFileName = "project.uiproj";
1721
+ constructor(fileSystem, logger) {
1722
+ this.fileSystem = fileSystem;
1723
+ this.logger = logger;
1724
+ }
1725
+ async restoreAsync(_options, _cancellationToken) {
1726
+ this.logger.info("Restore operation is a noop");
1727
+ return ToolResult.success();
1728
+ }
1729
+ async validateAsync(_options, _cancellationToken) {
1730
+ this.logger.info("Validate operation is a noop");
1731
+ return ToolResult.success();
1732
+ }
1733
+ async buildAsync(_options, _cancellationToken) {
1734
+ this.logger.info("Build operation is a noop");
1735
+ return ToolResult.success();
1736
+ }
1737
+ async packAsync(_options, _cancellationToken) {
1738
+ this.logger.info("Pack operation is a noop");
1739
+ return ToolResult.success();
1740
+ }
1741
+ async getUiProjectAsync(projectPath) {
1742
+ const filePath = Path.join(projectPath, ProjectTool.ProjectFileName);
1743
+ if (!await this.fileSystem.exists(filePath)) {
1744
+ return;
1745
+ }
1746
+ const raw = await this.fileSystem.readFile(filePath);
1747
+ if (!raw) {
1748
+ return;
1749
+ }
1750
+ const json = typeof raw === "string" ? raw : new TextDecoder("utf-8").decode(raw);
1751
+ return JSON.parse(json);
1752
+ }
1753
+ async dispose() {}
1754
+ }
1755
+ class ToolsFactoryRepository {
1756
+ projectFactoryMap = new Map;
1757
+ solutionFactory = null;
1758
+ registerProjectToolFactory(factory) {
1759
+ for (const type of factory.supportedTypes) {
1760
+ if (this.projectFactoryMap.has(type)) {
1761
+ console.warn(`Tool factory already registered for project type '${type}', skipping.`);
1762
+ continue;
1763
+ }
1764
+ this.projectFactoryMap.set(type, factory);
1765
+ }
1766
+ }
1767
+ registerSolutionToolFactory(factory) {
1768
+ this.solutionFactory = factory;
1769
+ }
1770
+ getSolutionToolFactory() {
1771
+ if (!this.solutionFactory) {
1772
+ throw new Error("No solution tool factory is registered");
1773
+ }
1774
+ return this.solutionFactory;
1775
+ }
1776
+ canHandleProject(projectType) {
1777
+ return this.projectFactoryMap.has(projectType);
1778
+ }
1779
+ getProjectToolFactory(projectType) {
1780
+ const factory = this.projectFactoryMap.get(projectType);
1781
+ if (!factory) {
1782
+ throw new Error(`No tool factory found for project type '${projectType}'`);
1783
+ }
1784
+ return factory;
1785
+ }
1786
+ reset() {
1787
+ this.projectFactoryMap.clear();
1788
+ this.solutionFactory = null;
1789
+ }
1790
+ }
1791
+ var REGISTRY_KEY = Symbol.for("@uipath/solutionpackager-tool-core/toolsFactoryRepository");
1792
+ var _global = globalThis;
1793
+ if (!_global[REGISTRY_KEY]) {
1794
+ _global[REGISTRY_KEY] = new ToolsFactoryRepository;
1795
+ }
1796
+ var toolsFactoryRepository = _global[REGISTRY_KEY];
3
1797
  // ../packager/packager-tool-apiworkflow/src/i18n/locales/de.json
4
1798
  var de_default = {
5
1799
  toolApiworkflow: {
@@ -26,7 +1820,7 @@ var de_default = {
26
1820
  };
27
1821
 
28
1822
  // ../packager/packager-tool-apiworkflow/src/i18n/locales/en.ts
29
- var en = {
1823
+ var en2 = {
30
1824
  toolApiworkflow: {
31
1825
  info: {
32
1826
  restoreNotRequired: "Restore operation is not required for API projects",
@@ -363,7 +2157,7 @@ var zu_default = {
363
2157
  };
364
2158
 
365
2159
  // ../packager/packager-tool-apiworkflow/src/i18n/index.ts
366
- I18nManager.registerTranslations("en", en);
2160
+ I18nManager.registerTranslations("en", en2);
367
2161
  I18nManager.registerTranslations("de", de_default);
368
2162
  I18nManager.registerTranslations("es", es_default);
369
2163
  I18nManager.registerTranslations("es-MX", es_MX_default);
@@ -379,27 +2173,7 @@ I18nManager.registerTranslations("zh-CN", zh_CN_default);
379
2173
  I18nManager.registerTranslations("zh-TW", zh_TW_default);
380
2174
  I18nManager.registerTranslations("zu", zu_default);
381
2175
 
382
- // ../packager/packager-tool-apiworkflow/src/index.ts
383
- import { toolsFactoryRepository } from "@uipath/solutionpackager-tool-core";
384
-
385
- // ../packager/packager-tool-apiworkflow/src/api-workflow-tool-factory.ts
386
- import {
387
- ProjectTypes as ProjectTypes2
388
- } from "@uipath/solutionpackager-tool-core";
389
-
390
2176
  // ../packager/packager-tool-apiworkflow/src/api-workflows-tool.ts
391
- import {
392
- NugetConstants,
393
- NugetPackager,
394
- Path,
395
- ProjectTool,
396
- ProjectTypes,
397
- TemporaryStorageService,
398
- ToolErrorCodes,
399
- ToolResult,
400
- translate
401
- } from "@uipath/solutionpackager-tool-core";
402
-
403
2177
  class ApiWorkflowsTool extends ProjectTool {
404
2178
  _temporaryStorage;
405
2179
  constructor(fileSystem, logger) {
@@ -530,7 +2304,7 @@ class ApiWorkflowsTool extends ProjectTool {
530
2304
 
531
2305
  // ../packager/packager-tool-apiworkflow/src/api-workflow-tool-factory.ts
532
2306
  class ApiWorkflowToolFactory {
533
- supportedTypes = [ProjectTypes2.Api];
2307
+ supportedTypes = [ProjectTypes.Api];
534
2308
  async createAsync(logger, fileSystem) {
535
2309
  return new ApiWorkflowsTool(fileSystem, logger);
536
2310
  }