@shad0wz7/nestjs-pdf 2.4.3 → 2.5.1

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/index.cjs ADDED
@@ -0,0 +1,3840 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region \0rolldown/runtime.js
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
12
+ key = keys[i];
13
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
21
+ value: mod,
22
+ enumerable: true
23
+ }) : target, mod));
24
+ //#endregion
25
+ let node_path = require("node:path");
26
+ let _nestjs_common = require("@nestjs/common");
27
+ let pdf_lib = require("pdf-lib");
28
+ let _gboutte_nestjs_hbs = require("@gboutte/nestjs-hbs");
29
+ let p_limit = require("p-limit");
30
+ p_limit = __toESM(p_limit);
31
+ let deepmerge_ts = require("deepmerge-ts");
32
+ let node_fs = require("node:fs");
33
+ let _puppeteer_browsers = require("@puppeteer/browsers");
34
+ let puppeteer = require("puppeteer");
35
+ let ejs = require("ejs");
36
+ let eta = require("eta");
37
+ let mjml = require("mjml");
38
+ mjml = __toESM(mjml);
39
+ let mustache = require("mustache");
40
+ mustache = __toESM(mustache);
41
+ let nunjucks = require("nunjucks");
42
+ let pug = require("pug");
43
+ //#region src/helpers/getRelativePath.helper.ts
44
+ /**
45
+ * Get the relative path to a value from the module directory.
46
+ * @param moduleDir the path of the module, typically __dirname
47
+ * @param relativeToModule the path to the value relative to the module directory
48
+ * @returns the relative path from the current working directory to the value
49
+ * @example
50
+ * getRelativePathToValue(__dirname, './templates/my-template.hbs');
51
+ * // returns 'context/pdf/templates/my-template.hbs' if the current working directory is '/
52
+ */
53
+ function getRelativePathToValue(moduleDir, relativeToModule) {
54
+ const fullTemplatePath = (0, node_path.resolve)(moduleDir, relativeToModule);
55
+ return (0, node_path.relative)(process.cwd(), fullTemplatePath);
56
+ }
57
+ //#endregion
58
+ //#region src/helpers/signature.helper.ts
59
+ let pdfjsPromise;
60
+ async function loadPdfjs() {
61
+ if (!pdfjsPromise) try {
62
+ pdfjsPromise = await import("pdfjs-dist/legacy/build/pdf.mjs");
63
+ } catch (error) {
64
+ pdfjsPromise = void 0;
65
+ throw new Error([
66
+ "Failed to load pdfjs-dist.",
67
+ "If you use anchor-based signature placement in Node.js, make sure @napi-rs/canvas is installed.",
68
+ "Try: npm install @napi-rs/canvas",
69
+ "",
70
+ `Original error: ${error instanceof Error ? error.message : String(error)}`
71
+ ].join("\n"), { cause: error });
72
+ }
73
+ return pdfjsPromise;
74
+ }
75
+ function toU8(input) {
76
+ return new Uint8Array(input);
77
+ }
78
+ async function findAnchorPosition(pdfBytes, anchorText) {
79
+ const pdfjsLib = await loadPdfjs();
80
+ const loadingTask = pdfjsLib.getDocument({ data: pdfBytes });
81
+ try {
82
+ const pdf = await loadingTask.promise;
83
+ for (let pageNum = 1; pageNum <= pdf.numPages; pageNum++) {
84
+ const page = await pdf.getPage(pageNum);
85
+ const viewport = page.getViewport({ scale: 1 });
86
+ const textContent = await page.getTextContent();
87
+ for (const itemRaw of textContent.items) {
88
+ const item = itemRaw;
89
+ if (!item.str?.includes(anchorText)) continue;
90
+ const [_a, _b, _c, _d, e, f] = pdfjsLib.Util.transform(viewport.transform, item.transform);
91
+ const x = e;
92
+ const y = viewport.height - f;
93
+ return {
94
+ pageIndex: pageNum - 1,
95
+ x,
96
+ y,
97
+ pageWidth: viewport.width,
98
+ pageHeight: viewport.height
99
+ };
100
+ }
101
+ }
102
+ return null;
103
+ } finally {
104
+ await loadingTask.destroy();
105
+ }
106
+ }
107
+ function addSignatureFieldAt(pdfDoc, pageIndex, opts) {
108
+ const { fieldName, x, y, width, height } = opts;
109
+ const context = pdfDoc.context;
110
+ const page = pdfDoc.getPages()[pageIndex];
111
+ if (!page) throw new Error(`Page ${pageIndex} not found`);
112
+ const rectArray = context.obj([
113
+ pdf_lib.PDFNumber.of(x),
114
+ pdf_lib.PDFNumber.of(y),
115
+ pdf_lib.PDFNumber.of(x + width),
116
+ pdf_lib.PDFNumber.of(y + height)
117
+ ]);
118
+ const widgetDict = context.obj({
119
+ Type: pdf_lib.PDFName.of("Annot"),
120
+ Subtype: pdf_lib.PDFName.of("Widget"),
121
+ Rect: rectArray,
122
+ F: pdf_lib.PDFNumber.of(4),
123
+ P: page.ref
124
+ });
125
+ const widgetRef = context.register(widgetDict);
126
+ const fieldDict = context.obj({
127
+ FT: pdf_lib.PDFName.of("Sig"),
128
+ T: pdf_lib.PDFString.of(fieldName),
129
+ Ff: pdf_lib.PDFNumber.of(0),
130
+ Kids: context.obj([widgetRef])
131
+ });
132
+ const fieldRef = context.register(fieldDict);
133
+ widgetDict.set(pdf_lib.PDFName.of("Parent"), fieldRef);
134
+ let annots = page.node.lookupMaybe(pdf_lib.PDFName.of("Annots"), pdf_lib.PDFArray);
135
+ if (!annots) {
136
+ annots = context.obj([]);
137
+ page.node.set(pdf_lib.PDFName.of("Annots"), annots);
138
+ }
139
+ annots.push(widgetRef);
140
+ let acroForm = pdfDoc.catalog.lookupMaybe(pdf_lib.PDFName.of("AcroForm"), pdf_lib.PDFDict);
141
+ if (!acroForm) {
142
+ acroForm = context.obj({
143
+ Fields: context.obj([]),
144
+ SigFlags: pdf_lib.PDFNumber.of(3)
145
+ });
146
+ const acroFormRef = context.register(acroForm);
147
+ pdfDoc.catalog.set(pdf_lib.PDFName.of("AcroForm"), acroFormRef);
148
+ }
149
+ let fields = acroForm.lookupMaybe(pdf_lib.PDFName.of("Fields"), pdf_lib.PDFArray);
150
+ if (!fields) {
151
+ fields = context.obj([]);
152
+ acroForm.set(pdf_lib.PDFName.of("Fields"), fields);
153
+ }
154
+ fields.push(fieldRef);
155
+ return {
156
+ fieldRef,
157
+ widgetRef
158
+ };
159
+ }
160
+ async function addSignatureFieldUsingAnchor(pdf, fieldName = "SignatureDebtor", anchorText = "__SIG_DEBTOR_ANCHOR__") {
161
+ const bytes = toU8(pdf);
162
+ const anchor = await findAnchorPosition(bytes.slice(), anchorText);
163
+ const pdfDoc = await pdf_lib.PDFDocument.load(bytes);
164
+ const sigWidth = 240;
165
+ const sigHeight = 50;
166
+ if (anchor) {
167
+ const pageIndex = anchor.pageIndex;
168
+ const { width: pw, height: ph } = pdfDoc.getPages()[pageIndex].getSize();
169
+ const padX = 40;
170
+ const padY = 7;
171
+ let x = anchor.x - sigWidth / 2 + padX;
172
+ let y = anchor.y - sigHeight + padY;
173
+ const margin = 10;
174
+ x = Math.max(margin, Math.min(x, pw - sigWidth - margin));
175
+ y = Math.max(margin, Math.min(y, ph - sigHeight - margin));
176
+ addSignatureFieldAt(pdfDoc, anchor.pageIndex, {
177
+ fieldName,
178
+ x,
179
+ y,
180
+ width: sigWidth,
181
+ height: sigHeight
182
+ });
183
+ } else {
184
+ const pages = pdfDoc.getPages();
185
+ const pageIndex = pages.length - 1;
186
+ const { width: pageWidth } = pages[pageIndex].getSize();
187
+ addSignatureFieldAt(pdfDoc, pageIndex, {
188
+ fieldName,
189
+ x: (pageWidth - sigWidth) / 2,
190
+ y: 90,
191
+ width: sigWidth,
192
+ height: sigHeight
193
+ });
194
+ }
195
+ return await pdfDoc.save();
196
+ }
197
+ //#endregion
198
+ //#region src/helpers/deepMergePdfparams.ts
199
+ function mergePuppeteerParameters(defaults, overrides) {
200
+ if (!overrides) return { ...defaults };
201
+ return (0, deepmerge_ts.deepmerge)(defaults, overrides);
202
+ }
203
+ //#endregion
204
+ //#region src/helpers/tokens.ts
205
+ const PDF_PARAMETERS = "PDF_PARAMETERS";
206
+ const HANDLEBARS_PARAMETERS = "HANDLEBARS_PARAMETERS";
207
+ //#endregion
208
+ //#region \0@oxc-project+runtime@0.142.0/helpers/esm/decorateMetadata.js
209
+ function __decorateMetadata(k, v) {
210
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
211
+ }
212
+ //#endregion
213
+ //#region \0@oxc-project+runtime@0.142.0/helpers/esm/decorateParam.js
214
+ function __decorateParam(paramIndex, decorator) {
215
+ return function(target, key) {
216
+ decorator(target, key, paramIndex);
217
+ };
218
+ }
219
+ //#endregion
220
+ //#region \0@oxc-project+runtime@0.142.0/helpers/esm/decorate.js
221
+ function __decorate(decorators, target, key, desc) {
222
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
223
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
224
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
225
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
226
+ }
227
+ //#endregion
228
+ //#region src/puppeteer/browser/browser.service.ts
229
+ async function sleep(ms) {
230
+ await new Promise((r) => setTimeout(r, ms));
231
+ }
232
+ async function rmWithRetries(dir, retries = 5) {
233
+ for (let attempt = 1; attempt <= retries; attempt++) try {
234
+ await node_fs.promises.rm(dir, {
235
+ recursive: true,
236
+ force: true
237
+ });
238
+ return;
239
+ } catch (err) {
240
+ const code = err?.code;
241
+ if (!(code === "EPERM" || code === "EBUSY" || code === "ENOTEMPTY") || attempt === retries) throw err;
242
+ await sleep(50 * 2 ** (attempt - 1));
243
+ }
244
+ }
245
+ function isTargetClosedError(error) {
246
+ if (!(error instanceof Error)) return false;
247
+ return error.name === "TargetCloseError" || error.message.includes("Target closed") || error.message.includes("Target.createTarget");
248
+ }
249
+ let BrowserService = class BrowserService {
250
+ cacheDir;
251
+ options;
252
+ _browserInstance = null;
253
+ browser;
254
+ activeJobs = 0;
255
+ totalJobs = 0;
256
+ recycleRequested = false;
257
+ recycling = false;
258
+ browserTag;
259
+ useLockedBrowser;
260
+ buildId;
261
+ constructor(pdfParams) {
262
+ this.cacheDir = (0, node_path.resolve)(".cache/puppeteer-browser");
263
+ this.options = pdfParams;
264
+ if (pdfParams.cleanupBrowserCacheOnExit) this.registerCleanupHooks();
265
+ this.loadBuildId();
266
+ this.loadBrowser();
267
+ this.loadBrowserTag();
268
+ this.loadUseLockedBrowser();
269
+ }
270
+ async onModuleDestroy() {
271
+ if (this._browserInstance?.connected) try {
272
+ await this._browserInstance.close();
273
+ } catch (error) {
274
+ _nestjs_common.Logger.warn(`Failed to close browser on module destroy: ${error instanceof Error ? error.message : String(error)}`);
275
+ }
276
+ await this.cleanupCacheBestEffort();
277
+ }
278
+ async getBrowserInstance(args, headless, executablePathBin) {
279
+ if (!this._browserInstance?.connected) this._browserInstance = await this.launchBrowser(args, headless, executablePathBin);
280
+ return this._browserInstance;
281
+ }
282
+ async createContext(args, headless, executablePath) {
283
+ const browser = await this.getBrowserInstance(args, headless, executablePath);
284
+ try {
285
+ return await browser.createBrowserContext();
286
+ } catch (error) {
287
+ if (!isTargetClosedError(error)) throw error;
288
+ _nestjs_common.Logger.warn("Puppeteer browser closed while creating a context, retrying once");
289
+ this._browserInstance = null;
290
+ return await (await this.getBrowserInstance(args, headless, executablePath)).createBrowserContext();
291
+ }
292
+ }
293
+ markJobStarted() {
294
+ this.activeJobs += 1;
295
+ this.totalJobs += 1;
296
+ if (this.totalJobs >= 200) this.recycleRequested = true;
297
+ }
298
+ async markJobFinished() {
299
+ this.activeJobs = Math.max(0, this.activeJobs - 1);
300
+ await this.recycleBrowserIfNeeded();
301
+ }
302
+ async recycleBrowserIfNeeded() {
303
+ if (!this.recycleRequested) return;
304
+ if (this.recycling) return;
305
+ if (this.activeJobs > 0) return;
306
+ if (!this._browserInstance) return;
307
+ this.recycling = true;
308
+ try {
309
+ if (this._browserInstance.connected) await this._browserInstance.close();
310
+ this._browserInstance = null;
311
+ this.totalJobs = 0;
312
+ this.recycleRequested = false;
313
+ _nestjs_common.Logger.log("Puppeteer browser recycled successfully");
314
+ } catch (error) {
315
+ _nestjs_common.Logger.warn(`Failed to recycle browser: ${error instanceof Error ? error.message : String(error)}`);
316
+ } finally {
317
+ this.recycling = false;
318
+ }
319
+ }
320
+ async cleanupCacheBestEffort() {
321
+ const logger = new _nestjs_common.Logger("NestJsPdf");
322
+ const dir = this.cacheDir;
323
+ try {
324
+ if (!(0, node_fs.existsSync)(dir)) return;
325
+ logger.log(`Cleanup puppeteer cache on signal: ${dir}`);
326
+ await rmWithRetries(dir, 6);
327
+ if ((0, node_fs.existsSync)(dir)) {
328
+ await sleep(100);
329
+ await rmWithRetries(dir, 3);
330
+ }
331
+ logger.log("Cleanup done");
332
+ } catch (err) {
333
+ logger.error(`Cleanup failed for ${dir}`, err instanceof Error ? err.stack : String(err));
334
+ }
335
+ try {
336
+ const leftover = await node_fs.promises.readdir(dir, { recursive: true });
337
+ logger.warn(`Leftover files: ${leftover.slice(0, 20).join(", ")}...`);
338
+ } catch {
339
+ logger.log(`No leftover files in ${dir}`);
340
+ }
341
+ }
342
+ async install(lock = false) {
343
+ const browser = this.browser;
344
+ const versionTag = this.browserTag;
345
+ const browserPlatform = (0, _puppeteer_browsers.detectBrowserPlatform)() ?? _puppeteer_browsers.BrowserPlatform.LINUX;
346
+ let buildId;
347
+ if (this.buildId === void 0) buildId = await (0, _puppeteer_browsers.resolveBuildId)(browser, browserPlatform, versionTag);
348
+ else buildId = this.buildId;
349
+ _nestjs_common.Logger.log(`Browser ${browser} ${versionTag} build id: ${buildId}`, "NestJsPdf");
350
+ if (await this.hasBrowserInstalled(browser, buildId)) {
351
+ _nestjs_common.Logger.log("Browser already installed", "NestJsPdf");
352
+ if (lock) this.writeLockFile(browser, buildId);
353
+ return;
354
+ } else {
355
+ _nestjs_common.Logger.log("Starting browser installation", "NestJsPdf");
356
+ const installOption = {
357
+ cacheDir: this.cacheDir,
358
+ browser,
359
+ buildId,
360
+ baseUrl: this.options?.browserInstallBaseUrl ?? void 0
361
+ };
362
+ if (await (0, _puppeteer_browsers.canDownload)(installOption)) {
363
+ _nestjs_common.Logger.log(`Installing ${installOption.browser} ${installOption.buildId}`, "NestJsPdf");
364
+ const installedBrowser = await (0, _puppeteer_browsers.install)(installOption);
365
+ if (await this.hasBrowserInstalled(browser, buildId)) {
366
+ _nestjs_common.Logger.log("Browser installed successfully", "NestJsPdf");
367
+ if (lock) this.writeLockFile(browser, buildId);
368
+ return installedBrowser;
369
+ } else _nestjs_common.Logger.error("Browser installation failed", "NestJsPdf");
370
+ } else _nestjs_common.Logger.error(`Error, can't install ${installOption.browser} ${installOption.buildId}`, "NestJsPdf");
371
+ }
372
+ return null;
373
+ }
374
+ registerCleanupHooks() {
375
+ const cleanup = async (signal) => {
376
+ try {
377
+ _nestjs_common.Logger.log(`Received ${signal}, cleaning up puppeteer cache...`, "NestJsPdf");
378
+ await this.cleanupCacheBestEffort();
379
+ process.exit(0);
380
+ } catch {
381
+ process.exit(1);
382
+ }
383
+ };
384
+ const cleanupHandler = (signal) => {
385
+ cleanup(signal);
386
+ };
387
+ process.once("SIGTERM", cleanupHandler);
388
+ process.once("SIGINT", cleanupHandler);
389
+ process.once("exit", cleanupHandler);
390
+ }
391
+ loadBrowser() {
392
+ let browser;
393
+ if (this.options?.browser === void 0) browser = _puppeteer_browsers.Browser.CHROMIUM;
394
+ else browser = this.options.browser;
395
+ this.browser = browser;
396
+ }
397
+ setBrowser(browser) {
398
+ this.browser = browser;
399
+ }
400
+ getBrowser() {
401
+ return this.browser;
402
+ }
403
+ loadBrowserTag() {
404
+ let versionTag;
405
+ if (this.options?.browserTag === void 0) if (this.browser === _puppeteer_browsers.Browser.CHROMIUM) versionTag = "latest";
406
+ else versionTag = "stable";
407
+ else versionTag = this.options.browserTag;
408
+ this.browserTag = versionTag;
409
+ }
410
+ loadBuildId() {
411
+ let buildId;
412
+ if (this.options?.buildId === void 0) buildId = void 0;
413
+ else buildId = this.options.buildId;
414
+ this.buildId = buildId;
415
+ }
416
+ setBrowserTag(browserTag) {
417
+ this.browserTag = browserTag;
418
+ }
419
+ getBrowserTag() {
420
+ return this.browserTag;
421
+ }
422
+ getBuildId() {
423
+ return this.buildId;
424
+ }
425
+ setBuildId(value) {
426
+ this.buildId = value;
427
+ }
428
+ loadUseLockedBrowser() {
429
+ let useLockedBrowser;
430
+ if (this.options?.useLockedBrowser === void 0) useLockedBrowser = false;
431
+ else useLockedBrowser = this.options.useLockedBrowser;
432
+ this.useLockedBrowser = useLockedBrowser;
433
+ }
434
+ async hasBrowserInstalled(browser, buildId) {
435
+ return (await (0, _puppeteer_browsers.getInstalledBrowsers)({ cacheDir: this.cacheDir })).find((insBrowser) => {
436
+ return insBrowser.browser === browser && insBrowser.buildId === buildId;
437
+ }) !== void 0;
438
+ }
439
+ async getExecutablePath() {
440
+ const browser = this.browser;
441
+ const versionTag = this.browserTag;
442
+ const browserPlatform = (0, _puppeteer_browsers.detectBrowserPlatform)() ?? _puppeteer_browsers.BrowserPlatform.LINUX;
443
+ let buildId = null;
444
+ if (this.useLockedBrowser) {
445
+ buildId = this.getLockedBuildId(browser);
446
+ _nestjs_common.Logger.log(`Using locked browser ${buildId}`, "NestJsPdf");
447
+ }
448
+ buildId ??= await (0, _puppeteer_browsers.resolveBuildId)(browser, browserPlatform, versionTag);
449
+ const installedBrowser = (await (0, _puppeteer_browsers.getInstalledBrowsers)({ cacheDir: this.cacheDir })).find((insBrowser) => {
450
+ return insBrowser.browser === browser && insBrowser.buildId === buildId;
451
+ });
452
+ if (installedBrowser === void 0) {
453
+ const newinstalledBrowser = await this.install();
454
+ if (newinstalledBrowser === null || newinstalledBrowser === void 0) throw new Error("Could not install browser");
455
+ else return newinstalledBrowser.executablePath;
456
+ }
457
+ return installedBrowser.executablePath;
458
+ }
459
+ async launchBrowser(args, headless, executablePathBin) {
460
+ const executablePath = executablePathBin ?? await this.getExecutablePath();
461
+ const browser = await (0, puppeteer.launch)({
462
+ executablePath,
463
+ headless,
464
+ args
465
+ });
466
+ browser.on("disconnected", () => {
467
+ _nestjs_common.Logger.warn("Puppeteer browser disconnected");
468
+ if (this._browserInstance === browser) this._browserInstance = null;
469
+ });
470
+ return browser;
471
+ }
472
+ writeLockFile(browser, buildId) {
473
+ const lockFile = (0, node_path.resolve)(this.cacheDir, `${browser}.lock`);
474
+ const data = JSON.stringify({
475
+ browser,
476
+ buildId,
477
+ date: (/* @__PURE__ */ new Date()).toISOString()
478
+ });
479
+ (0, node_fs.writeFileSync)(lockFile, data);
480
+ _nestjs_common.Logger.log(`Browser ${browser} locked to build ${buildId}`, "NestJsPdf");
481
+ }
482
+ getLockedBuildId(browser) {
483
+ const lockFile = (0, node_path.resolve)(this.cacheDir, `${browser}.lock`);
484
+ if ((0, node_fs.existsSync)(lockFile)) {
485
+ const data = (0, node_fs.readFileSync)(lockFile);
486
+ return JSON.parse(data.toString()).buildId;
487
+ }
488
+ return null;
489
+ }
490
+ };
491
+ BrowserService = __decorate([
492
+ (0, _nestjs_common.Injectable)(),
493
+ __decorateParam(0, (0, _nestjs_common.Inject)("PDF_PARAMETERS")),
494
+ __decorateMetadata("design:paramtypes", [Object])
495
+ ], BrowserService);
496
+ //#endregion
497
+ //#region src/puppeteer/engines/ejs/ejs.service.ts
498
+ let EjsService = class EjsService {
499
+ async render(template, data = {}, options) {
500
+ try {
501
+ return await (0, ejs.render)(template, data, {
502
+ async: true,
503
+ ...options
504
+ });
505
+ } catch (error) {
506
+ throw new Error(`EJS rendering failed: ${String(error)}`, { cause: error });
507
+ }
508
+ }
509
+ async renderFile(filePath, data = {}, options) {
510
+ try {
511
+ return await (0, ejs.renderFile)(filePath, data, {
512
+ async: true,
513
+ ...options
514
+ });
515
+ } catch (error) {
516
+ throw new Error(`EJS file rendering failed: ${String(error)}`, { cause: error });
517
+ }
518
+ }
519
+ };
520
+ EjsService = __decorate([(0, _nestjs_common.Injectable)()], EjsService);
521
+ //#endregion
522
+ //#region src/puppeteer/engines/eta/eta.service.ts
523
+ let EtaService = class EtaService {
524
+ eta;
525
+ templateCache = /* @__PURE__ */ new Map();
526
+ maxCacheSize = 100;
527
+ constructor() {
528
+ this.eta = new eta.Eta({
529
+ cache: true,
530
+ autoEscape: true,
531
+ useWith: true
532
+ });
533
+ }
534
+ /**
535
+ * Render an Eta template from a string
536
+ * @param template The template string to render
537
+ * @param data The data object to use for rendering
538
+ * @param options Optional Eta rendering options
539
+ * @returns The rendered HTML string
540
+ */
541
+ render(template, data = {}, options) {
542
+ try {
543
+ return (options && Object.keys(options).length > 0 ? new eta.Eta({
544
+ cache: true,
545
+ autoEscape: true,
546
+ useWith: true,
547
+ ...options,
548
+ varName: options.varName ?? "it"
549
+ }) : this.eta).renderString(template, data);
550
+ } catch (error) {
551
+ throw new Error(`Eta rendering failed: ${String(error)}`, { cause: error });
552
+ }
553
+ }
554
+ /**
555
+ * Render an Eta template from a file
556
+ * @param filePath The path to the template file
557
+ * @param data The data object to use for rendering
558
+ * @param options Optional Eta rendering options
559
+ * @returns The rendered HTML string
560
+ */
561
+ renderFile(filePath, data = {}, options) {
562
+ try {
563
+ const resolvedPath = (0, node_path.resolve)(filePath);
564
+ const useCache = options?.cache ?? true;
565
+ let template = useCache ? this.templateCache.get(resolvedPath) : void 0;
566
+ if (!template) {
567
+ template = (0, node_fs.readFileSync)(resolvedPath, "utf-8");
568
+ if (useCache && this.templateCache.size < this.maxCacheSize) this.templateCache.set(resolvedPath, template);
569
+ }
570
+ return this.render(template, data, options);
571
+ } catch (error) {
572
+ throw new Error(`Eta file rendering failed for ${filePath}: ${String(error)}`, { cause: error });
573
+ }
574
+ }
575
+ /**
576
+ * Clear the template cache
577
+ */
578
+ clearCache() {
579
+ this.templateCache.clear();
580
+ }
581
+ /**
582
+ * Get the current cache size
583
+ * @returns The number of cached templates
584
+ */
585
+ getCacheSize() {
586
+ return this.templateCache.size;
587
+ }
588
+ };
589
+ EtaService = __decorate([(0, _nestjs_common.Injectable)(), __decorateMetadata("design:paramtypes", [])], EtaService);
590
+ //#endregion
591
+ //#region src/puppeteer/engines/mjml/mjml.service.ts
592
+ let MjmlService = class MjmlService {
593
+ async render(template, options) {
594
+ const { html } = await (0, mjml.default)(template, options);
595
+ return html;
596
+ }
597
+ async renderFile(filePath, options) {
598
+ const template = (0, node_fs.readFileSync)(filePath, "utf-8");
599
+ return await this.render(template, options);
600
+ }
601
+ };
602
+ MjmlService = __decorate([(0, _nestjs_common.Injectable)()], MjmlService);
603
+ //#endregion
604
+ //#region src/puppeteer/engines/mustache/mustache.service.ts
605
+ let MustacheService = class MustacheService {
606
+ templateCache = /* @__PURE__ */ new Map();
607
+ maxCacheSize = 100;
608
+ /**
609
+ * Render a Mustache template from a string
610
+ * @param template The template string to render
611
+ * @param data The data object to use for rendering
612
+ * @param options Optional Mustache rendering options
613
+ * @returns The rendered HTML string
614
+ */
615
+ render(template, data = {}, options) {
616
+ try {
617
+ const tags = options?.tags ?? ["{{", "}}"];
618
+ return mustache.default.render(template, data, void 0, {
619
+ tags,
620
+ escape: options?.escape
621
+ });
622
+ } catch (error) {
623
+ throw new Error(`Mustache rendering failed: ${String(error)}`, { cause: error });
624
+ }
625
+ }
626
+ /**
627
+ * Render a Mustache template from a file
628
+ * @param filePath The path to the template file
629
+ * @param data The data object to use for rendering
630
+ * @param options Optional Mustache rendering options
631
+ * @returns The rendered HTML string
632
+ */
633
+ renderFile(filePath, data = {}, options) {
634
+ try {
635
+ const resolvedPath = (0, node_path.resolve)(filePath);
636
+ let template = this.templateCache.get(resolvedPath);
637
+ if (!template) {
638
+ template = (0, node_fs.readFileSync)(resolvedPath, "utf-8");
639
+ if (this.templateCache.size < this.maxCacheSize) this.templateCache.set(resolvedPath, template);
640
+ }
641
+ return this.render(template, data, options);
642
+ } catch (error) {
643
+ throw new Error(`Mustache file rendering failed for ${filePath}: ${String(error)}`, { cause: error });
644
+ }
645
+ }
646
+ /**
647
+ * Clear the template cache
648
+ */
649
+ clearCache() {
650
+ this.templateCache.clear();
651
+ }
652
+ /**
653
+ * Get the current cache size
654
+ * @returns The number of cached templates
655
+ */
656
+ getCacheSize() {
657
+ return this.templateCache.size;
658
+ }
659
+ };
660
+ MustacheService = __decorate([(0, _nestjs_common.Injectable)()], MustacheService);
661
+ //#endregion
662
+ //#region src/puppeteer/engines/nunjucks/nunjucks.service.ts
663
+ let NunjucksService = class NunjucksService {
664
+ constructor() {
665
+ (0, nunjucks.configure)({
666
+ noCache: true,
667
+ trimBlocks: true,
668
+ lstripBlocks: true
669
+ });
670
+ }
671
+ render(template, data = {}, options) {
672
+ try {
673
+ if (options) {
674
+ const configOptions = {
675
+ noCache: options.noCache ?? true,
676
+ watch: options.watch ?? false,
677
+ throwOnUndefined: options.throwOnUndefined ?? false,
678
+ trimBlocks: options.trimBlocks ?? true,
679
+ lstripBlocks: options.lstripBlocks ?? true
680
+ };
681
+ (0, nunjucks.configure)(configOptions);
682
+ }
683
+ return (0, nunjucks.renderString)(template, data);
684
+ } catch (error) {
685
+ throw new Error(`Nunjucks rendering failed: ${String(error)}`, { cause: error });
686
+ }
687
+ }
688
+ renderFile(filePath, data = {}, options) {
689
+ try {
690
+ if (options) {
691
+ const configOptions = {
692
+ noCache: options.noCache ?? true,
693
+ watch: options.watch ?? false,
694
+ throwOnUndefined: options.throwOnUndefined ?? false,
695
+ trimBlocks: options.trimBlocks ?? true,
696
+ lstripBlocks: options.lstripBlocks ?? true
697
+ };
698
+ (0, nunjucks.configure)(configOptions);
699
+ }
700
+ return (0, nunjucks.render)(filePath, data);
701
+ } catch (error) {
702
+ throw new Error(`Nunjucks file rendering failed: ${String(error)}`, { cause: error });
703
+ }
704
+ }
705
+ };
706
+ NunjucksService = __decorate([(0, _nestjs_common.Injectable)(), __decorateMetadata("design:paramtypes", [])], NunjucksService);
707
+ //#endregion
708
+ //#region src/puppeteer/engines/pug/pug.service.ts
709
+ let PugService = class PugService {
710
+ render(template, data = {}, options) {
711
+ try {
712
+ return (0, pug.compile)(template, { ...options })(data);
713
+ } catch (error) {
714
+ throw new Error(`Pug rendering failed: ${String(error)}`, { cause: error });
715
+ }
716
+ }
717
+ renderFile(filePath, data = {}, options) {
718
+ try {
719
+ const template = (0, node_fs.readFileSync)(filePath, "utf-8");
720
+ return this.render(template, data, options);
721
+ } catch (error) {
722
+ throw new Error(`Pug file rendering failed: ${String(error)}`, { cause: error });
723
+ }
724
+ }
725
+ };
726
+ PugService = __decorate([(0, _nestjs_common.Injectable)()], PugService);
727
+ //#endregion
728
+ //#region src/puppeteer/libs/requireService.utils.ts
729
+ function requireService(service, name) {
730
+ if (!service) throw new Error(`${name} service is not available. If the problem persists, open an issue in the repo.`);
731
+ return service;
732
+ }
733
+ //#endregion
734
+ //#region src/puppeteer/puppeteer.service.ts
735
+ let PuppeteerService = class PuppeteerService {
736
+ browserService;
737
+ options;
738
+ hbsService;
739
+ mjmlService;
740
+ pugService;
741
+ ejsService;
742
+ nunjucksService;
743
+ etaService;
744
+ mustacheService;
745
+ constructor(browserService, options, hbsService, mjmlService, pugService, ejsService, nunjucksService, etaService, mustacheService) {
746
+ this.browserService = browserService;
747
+ this.options = options;
748
+ this.hbsService = hbsService;
749
+ this.mjmlService = mjmlService;
750
+ this.pugService = pugService;
751
+ this.ejsService = ejsService;
752
+ this.nunjucksService = nunjucksService;
753
+ this.etaService = etaService;
754
+ this.mustacheService = mustacheService;
755
+ }
756
+ limit = (0, p_limit.default)(3);
757
+ async generatePdfFromHtml(html, options) {
758
+ return this.limit(async () => {
759
+ const mergePuppeteerOptions = mergePuppeteerParameters(this.options, options);
760
+ if (mergePuppeteerOptions.chromiumRevision !== void 0) _nestjs_common.Logger.warn("Using `chromiumRevision` is no longer supported since the puppeteer update.");
761
+ const headless = mergePuppeteerOptions.headless ?? true;
762
+ const executablePath = mergePuppeteerOptions.executablePath || void 0;
763
+ const args = mergePuppeteerOptions.extraPuppeteerArgs || [
764
+ "--autoplay-policy=user-gesture-required",
765
+ "--disable-background-networking",
766
+ "--disable-background-timer-throttling",
767
+ "--disable-backgrounding-occluded-windows",
768
+ "--disable-breakpad",
769
+ "--disable-client-side-phishing-detection",
770
+ "--disable-component-update",
771
+ "--disable-default-apps",
772
+ "--disable-dev-shm-usage",
773
+ "--disable-domain-reliability",
774
+ "--disable-extensions",
775
+ "--disable-features=AudioServiceOutOfProcess",
776
+ "--disable-hang-monitor",
777
+ "--disable-ipc-flooding-protection",
778
+ "--disable-notifications",
779
+ "--disable-offer-store-unmasked-wallet-cards",
780
+ "--disable-popup-blocking",
781
+ "--disable-print-preview",
782
+ "--disable-prompt-on-repost",
783
+ "--disable-renderer-backgrounding",
784
+ "--disable-setuid-sandbox",
785
+ "--disable-speech-api",
786
+ "--disable-sync",
787
+ "--hide-scrollbars",
788
+ "--ignore-gpu-blacklist",
789
+ "--metrics-recording-only",
790
+ "--mute-audio",
791
+ "--no-default-browser-check",
792
+ "--no-first-run",
793
+ "--no-pings",
794
+ "--password-store=basic",
795
+ "--use-gl=swiftshader",
796
+ "--use-mock-keychain",
797
+ "--disable-accelerated-2d-canvas",
798
+ "--no-zygote",
799
+ "--disable-gpu"
800
+ ];
801
+ this.browserService.markJobStarted();
802
+ let context = null;
803
+ try {
804
+ context = await this.browserService.createContext(args, headless, executablePath);
805
+ const page = await context.newPage();
806
+ const pdfOptions = mergePuppeteerOptions.pdfOptions ?? { format: "A4" };
807
+ await page.setContent(html, { waitUntil: "domcontentloaded" });
808
+ await page.emulateMediaType("screen");
809
+ await page.waitForNetworkIdle({
810
+ idleTime: 500,
811
+ timeout: 3e4
812
+ });
813
+ await page.evaluate(() => document.fonts.ready);
814
+ return await page.pdf(pdfOptions);
815
+ } catch (e) {
816
+ _nestjs_common.Logger.error(e);
817
+ throw e;
818
+ } finally {
819
+ if (context) try {
820
+ await context.close();
821
+ } catch (error) {
822
+ _nestjs_common.Logger.error(error);
823
+ }
824
+ await this.browserService.markJobFinished();
825
+ }
826
+ });
827
+ }
828
+ async generatePdfFromTemplateHbsString(template, parameters = {}, options) {
829
+ const html = requireService(this.hbsService, "Handlebars").render(template, parameters);
830
+ return this.generatePdfFromHtml(html, options);
831
+ }
832
+ async generatePdfFromTemplateHbsFile(file, parameters = {}, options) {
833
+ const html = requireService(this.hbsService, "Handlebars").renderFile(file, parameters);
834
+ return this.generatePdfFromHtml(html, options);
835
+ }
836
+ async generatePdfFromMjmlString(template, options) {
837
+ const html = await requireService(this.mjmlService, "MJML").render(template, options?.mjmlOptions ?? this.options.mjmlOptions);
838
+ return this.generatePdfFromHtml(html, options);
839
+ }
840
+ async generatePdfFromMjmlFile(file, options) {
841
+ const html = await requireService(this.mjmlService, "MJML").renderFile(file, options?.mjmlOptions ?? this.options.mjmlOptions);
842
+ return this.generatePdfFromHtml(html, options);
843
+ }
844
+ async generatePdfFromPugString(template, data = {}, options) {
845
+ const html = requireService(this.pugService, "Pug").render(template, data, options?.pugOptions ?? this.options.pugOptions);
846
+ return this.generatePdfFromHtml(html, options);
847
+ }
848
+ async generatePdfFromPugFile(file, data = {}, options) {
849
+ const html = requireService(this.pugService, "Pug").renderFile(file, data, options?.pugOptions ?? this.options.pugOptions);
850
+ return this.generatePdfFromHtml(html, options);
851
+ }
852
+ async generatePdfFromEjsString(template, data = {}, options) {
853
+ const html = await requireService(this.ejsService, "EJS").render(template, data, options?.ejsOptions ?? this.options.ejsOptions);
854
+ return this.generatePdfFromHtml(html, options);
855
+ }
856
+ async generatePdfFromEjsFile(file, data = {}, options) {
857
+ const html = await requireService(this.ejsService, "EJS").renderFile(file, data, options?.ejsOptions ?? this.options.ejsOptions);
858
+ return this.generatePdfFromHtml(html, options);
859
+ }
860
+ async generatePdfFromNunjucksString(template, data = {}, options) {
861
+ const html = requireService(this.nunjucksService, "Nunjucks").render(template, data, options?.nunjucksOptions ?? this.options.nunjucksOptions);
862
+ return this.generatePdfFromHtml(html, options);
863
+ }
864
+ async generatePdfFromNunjucksFile(file, data = {}, options) {
865
+ const html = requireService(this.nunjucksService, "Nunjucks").renderFile(file, data, options?.nunjucksOptions ?? this.options.nunjucksOptions);
866
+ return this.generatePdfFromHtml(html, options);
867
+ }
868
+ async generatePdfFromEtaString(template, data = {}, options) {
869
+ const html = requireService(this.etaService, "Eta").render(template, data, options?.etaOptions ?? this.options.etaOptions);
870
+ return this.generatePdfFromHtml(html, options);
871
+ }
872
+ async generatePdfFromEtaFile(file, data = {}, options) {
873
+ const html = requireService(this.etaService, "Eta").renderFile(file, data, options?.etaOptions ?? this.options.etaOptions);
874
+ return this.generatePdfFromHtml(html, options);
875
+ }
876
+ async generatePdfFromMustacheString(template, data = {}, options) {
877
+ const html = requireService(this.mustacheService, "Mustache").render(template, data, options?.mustacheOptions ?? this.options.mustacheOptions);
878
+ return this.generatePdfFromHtml(html, options);
879
+ }
880
+ async generatePdfFromMustacheFile(file, data = {}, options) {
881
+ const html = requireService(this.mustacheService, "Mustache").renderFile(file, data, options?.mustacheOptions ?? this.options.mustacheOptions);
882
+ return this.generatePdfFromHtml(html, options);
883
+ }
884
+ };
885
+ PuppeteerService = __decorate([
886
+ (0, _nestjs_common.Injectable)(),
887
+ __decorateParam(1, (0, _nestjs_common.Inject)(PDF_PARAMETERS)),
888
+ __decorateParam(2, (0, _nestjs_common.Optional)()),
889
+ __decorateParam(3, (0, _nestjs_common.Optional)()),
890
+ __decorateParam(4, (0, _nestjs_common.Optional)()),
891
+ __decorateParam(5, (0, _nestjs_common.Optional)()),
892
+ __decorateParam(6, (0, _nestjs_common.Optional)()),
893
+ __decorateParam(7, (0, _nestjs_common.Optional)()),
894
+ __decorateParam(8, (0, _nestjs_common.Optional)()),
895
+ __decorateMetadata("design:paramtypes", [
896
+ typeof BrowserService === "undefined" ? Object : BrowserService,
897
+ Object,
898
+ typeof _gboutte_nestjs_hbs.HandlebarsService === "undefined" ? Object : _gboutte_nestjs_hbs.HandlebarsService,
899
+ typeof MjmlService === "undefined" ? Object : MjmlService,
900
+ typeof PugService === "undefined" ? Object : PugService,
901
+ typeof EjsService === "undefined" ? Object : EjsService,
902
+ typeof NunjucksService === "undefined" ? Object : NunjucksService,
903
+ typeof EtaService === "undefined" ? Object : EtaService,
904
+ typeof MustacheService === "undefined" ? Object : MustacheService
905
+ ])
906
+ ], PuppeteerService);
907
+ //#endregion
908
+ //#region src/nestjs-pdf.service.ts
909
+ let NestjsPdfService = class NestjsPdfService {
910
+ puppeteerService;
911
+ constructor(puppeteerService) {
912
+ this.puppeteerService = puppeteerService;
913
+ }
914
+ /**
915
+ * @param html HTML string to convert to PDF
916
+ * @param options PDF generation options (optional)
917
+ * @returns PDF generated from the provided HTML
918
+ * @description This method uses the Puppeteer service to generate a PDF from an HTML string. Generation options can be customized by passing a `PuppeteerParameters` object as the second argument. This allows you to control various aspects of PDF rendering, such as page size, margins, background display, etc. If no options are provided, the default parameters defined in the Puppeteer service will be used.
919
+ */
920
+ generatePdfFromHtml(html, options) {
921
+ return this.puppeteerService.generatePdfFromHtml(html, options);
922
+ }
923
+ /**
924
+ * @param template Handlebars template string
925
+ * @param parameters Data parameters to inject into the template
926
+ * @param options PDF generation options (optional)
927
+ * @returns PDF generated from the provided Handlebars template with parameters applied
928
+ * @description This method generates a PDF from a Handlebars template provided as a string. The parameters to inject into the template are passed in the `parameters` object, which is used to render the template before converting it to PDF. PDF generation options can also be customized by passing a `PuppeteerParameters` object as the third argument. This allows you to control various aspects of PDF rendering, such as page size, margins, background display, etc. If no options are provided, the default parameters defined in the Puppeteer service will be used.
929
+ */
930
+ generatePdfFromTemplateHbsString(template, parameters = {}, options) {
931
+ return this.puppeteerService.generatePdfFromTemplateHbsString(template, parameters, options);
932
+ }
933
+ /**
934
+ * @param file Path to the Handlebars template file
935
+ * @param parameters Data parameters to inject into the template
936
+ * @param options PDF generation options (optional)
937
+ * @returns PDF generated from the Handlebars template at the provided file path with parameters applied
938
+ * @description This method generates a PDF from a Handlebars template located at the specified file path. The file path is passed as a string in the `file` parameter. The parameters to inject into the template are passed in the `parameters` object, which is used to render the template before converting it to PDF. PDF generation options can also be customized by passing a `PuppeteerParameters` object as the third argument. This allows you to control various aspects of PDF rendering, such as page size, margins, background display, etc. If no options are provided, the default parameters defined in the Puppeteer service will be used.
939
+ */
940
+ generatePdfFromTemplateHbsFile(file, parameters = {}, options) {
941
+ return this.puppeteerService.generatePdfFromTemplateHbsFile(file, parameters, options);
942
+ }
943
+ /**
944
+ * @param template MJML template string
945
+ * @param options PDF generation options (optional)
946
+ * @returns PDF generated from the provided MJML template
947
+ * @description This method generates a PDF from an MJML template provided as a string. MJML (MJML Markup Language) is a markup language designed to reduce the pain of coding a responsive email. The template is first rendered to HTML using the MJML renderer, then converted to PDF. PDF generation options can be customized by passing a `PuppeteerParameters` object as the second argument.
948
+ */
949
+ generatePdfFromMjmlString(template, options) {
950
+ return this.puppeteerService.generatePdfFromMjmlString(template, options);
951
+ }
952
+ /**
953
+ * @param file Path to the MJML template file
954
+ * @param options PDF generation options (optional)
955
+ * @returns PDF generated from the MJML template at the provided file path
956
+ * @description This method generates a PDF from an MJML template located at the specified file path. The file path is passed as a string in the `file` parameter. The template is first rendered to HTML using the MJML renderer, then converted to PDF. PDF generation options can be customized by passing a `PuppeteerParameters` object as the second argument.
957
+ */
958
+ generatePdfFromMjmlFile(file, options) {
959
+ return this.puppeteerService.generatePdfFromMjmlFile(file, options);
960
+ }
961
+ /**
962
+ * @param template EJS template string
963
+ * @param data Data to inject into the template
964
+ * @param options PDF generation options (optional)
965
+ * @returns PDF generated from the provided EJS template with data applied
966
+ * @description This method generates a PDF from an EJS (Embedded JavaScript) template provided as a string. EJS is a templating language with a simple, straightforward syntax. The data to inject into the template is passed in the `data` object, which is used to render the template before converting it to PDF. PDF generation options can be customized by passing a `PuppeteerParameters` object as the third argument.
967
+ */
968
+ generatePdfFromEjsString(template, data = {}, options) {
969
+ return this.puppeteerService.generatePdfFromEjsString(template, data, options);
970
+ }
971
+ /**
972
+ * @param file Path to the EJS template file
973
+ * @param data Data to inject into the template
974
+ * @param options PDF generation options (optional)
975
+ * @returns PDF generated from the EJS template at the provided file path with data applied
976
+ * @description This method generates a PDF from an EJS template located at the specified file path. The file path is passed as a string in the `file` parameter. The data to inject into the template is passed in the `data` object, which is used to render the template before converting it to PDF. PDF generation options can be customized by passing a `PuppeteerParameters` object as the third argument.
977
+ */
978
+ generatePdfFromEjsFile(file, data = {}, options) {
979
+ return this.puppeteerService.generatePdfFromEjsFile(file, data, options);
980
+ }
981
+ /**
982
+ * @param template Pug template string
983
+ * @param data Data to inject into the template
984
+ * @param options PDF generation options (optional)
985
+ * @returns PDF generated from the provided Pug template with data applied
986
+ * @description This method generates a PDF from a Pug template provided as a string. Pug is a clean, whitespace-sensitive syntax for writing HTML. The data to inject into the template is passed in the `data` object, which is used to render the template before converting it to PDF. PDF generation options can be customized by passing a `PuppeteerParameters` object as the third argument.
987
+ */
988
+ generatePdfFromPugString(template, data = {}, options) {
989
+ return this.puppeteerService.generatePdfFromPugString(template, data, options);
990
+ }
991
+ /**
992
+ * @param file Path to the Pug template file
993
+ * @param data Data to inject into the template
994
+ * @param options PDF generation options (optional)
995
+ * @returns PDF generated from the Pug template at the provided file path with data applied
996
+ * @description This method generates a PDF from a Pug template located at the specified file path. The file path is passed as a string in the `file` parameter. The data to inject into the template is passed in the `data` object, which is used to render the template before converting it to PDF. PDF generation options can be customized by passing a `PuppeteerParameters` object as the third argument.
997
+ */
998
+ generatePdfFromPugFile(file, data = {}, options) {
999
+ return this.puppeteerService.generatePdfFromPugFile(file, data, options);
1000
+ }
1001
+ /**
1002
+ * @param template Nunjucks template string
1003
+ * @param data Data to inject into the template
1004
+ * @param options PDF generation options (optional)
1005
+ * @returns PDF generated from the provided Nunjucks template with data applied
1006
+ * @description This method generates a PDF from a Nunjucks template provided as a string. Nunjucks is a powerful templating language with support for inheritance, macros, and filters. The data to inject into the template is passed in the `data` object, which is used to render the template before converting it to PDF. PDF generation options can be customized by passing a `PuppeteerParameters` object as the third argument.
1007
+ */
1008
+ generatePdfFromNunjucksString(template, data = {}, options) {
1009
+ return this.puppeteerService.generatePdfFromNunjucksString(template, data, options);
1010
+ }
1011
+ /**
1012
+ * @param file Path to the Nunjucks template file
1013
+ * @param data Data to inject into the template
1014
+ * @param options PDF generation options (optional)
1015
+ * @returns PDF generated from the Nunjucks template at the provided file path with data applied
1016
+ * @description This method generates a PDF from a Nunjucks template located at the specified file path. The file path is passed as a string in the `file` parameter. The data to inject into the template is passed in the `data` object, which is used to render the template before converting it to PDF. PDF generation options can be customized by passing a `PuppeteerParameters` object as the third argument.
1017
+ */
1018
+ generatePdfFromNunjucksFile(file, data = {}, options) {
1019
+ return this.puppeteerService.generatePdfFromNunjucksFile(file, data, options);
1020
+ }
1021
+ /**
1022
+ * @param template Eta template string
1023
+ * @param data Data to inject into the template
1024
+ * @param options PDF generation options (optional)
1025
+ * @returns PDF generated from the provided Eta template with data applied
1026
+ * @description This method generates a PDF from an Eta template provided as a string. Eta is a fast and lightweight embedded templating language with a syntax similar to EJS but with better performance. The data to inject into the template is passed in the `data` object, which is used to render the template before converting it to PDF. PDF generation options can be customized by passing a `PuppeteerParameters` object as the third argument.
1027
+ */
1028
+ generatePdfFromEtaString(template, data = {}, options) {
1029
+ return this.puppeteerService.generatePdfFromEtaString(template, data, options);
1030
+ }
1031
+ /**
1032
+ * @param file Path to the Eta template file
1033
+ * @param data Data to inject into the template
1034
+ * @param options PDF generation options (optional)
1035
+ * @returns PDF generated from the Eta template at the provided file path with data applied
1036
+ * @description This method generates a PDF from an Eta template located at the specified file path. The file path is passed as a string in the `file` parameter. The data to inject into the template is passed in the `data` object, which is used to render the template before converting it to PDF. PDF generation options can be customized by passing a `PuppeteerParameters` object as the third argument.
1037
+ */
1038
+ generatePdfFromEtaFile(file, data = {}, options) {
1039
+ return this.puppeteerService.generatePdfFromEtaFile(file, data, options);
1040
+ }
1041
+ /**
1042
+ * @param template Mustache template string
1043
+ * @param data Data to inject into the template
1044
+ * @param options PDF generation options (optional)
1045
+ * @returns PDF generated from the provided Mustache template with data applied
1046
+ * @description This method generates a PDF from a Mustache template provided as a string. Mustache is a logic-less template language that emphasizes readable and simple templates. The data to inject into the template is passed in the `data` object, which is used to render the template before converting it to PDF. PDF generation options can be customized by passing a `PuppeteerParameters` object as the third argument.
1047
+ */
1048
+ generatePdfFromMustacheString(template, data = {}, options) {
1049
+ return this.puppeteerService.generatePdfFromMustacheString(template, data, options);
1050
+ }
1051
+ /**
1052
+ * @param file Path to the Mustache template file
1053
+ * @param data Data to inject into the template
1054
+ * @param options PDF generation options (optional)
1055
+ * @returns PDF generated from the Mustache template at the provided file path with data applied
1056
+ * @description This method generates a PDF from a Mustache template located at the specified file path. The file path is passed as a string in the `file` parameter. The data to inject into the template is passed in the `data` object, which is used to render the template before converting it to PDF. PDF generation options can be customized by passing a `PuppeteerParameters` object as the third argument.
1057
+ */
1058
+ generatePdfFromMustacheFile(file, data = {}, options) {
1059
+ return this.puppeteerService.generatePdfFromMustacheFile(file, data, options);
1060
+ }
1061
+ /**
1062
+ * @param pdf The PDF bytes to modify
1063
+ * @param fieldName The name of the signature field to add (default: 'SignatureDebtor')
1064
+ * @param anchorText The text anchor to locate the signature field position (default: '__SIG_DEBTOR_ANCHOR__')
1065
+ * @returns Modified PDF with a signature field added at the anchor position
1066
+ * @description This method adds a signature field to a PDF using a text anchor as a reference for the field position. It uses the `addSignatureFieldUsingAnchor` function which finds the anchor in the PDF and inserts a signature field at that location. The signature field is named according to the `fieldName` parameter and the anchor is defined by `anchorText`.
1067
+ *
1068
+ * Usage example:
1069
+ * ```typescript
1070
+ * const modifiedPdf = await pdfService.addSignatureFieldSignatureDebtorRaw(
1071
+ * originalPdfBytes,
1072
+ * 'SignatureDebtor',
1073
+ * '__SIG_DEBTOR_ANCHOR__'
1074
+ * );
1075
+ * ```
1076
+ *
1077
+ * In this example, `originalPdfBytes` is a byte array representing the original PDF, `SignatureDebtor` is the name of the signature field to add, and `__SIG_DEBTOR_ANCHOR__` is the anchor text used to position the signature field in the PDF.
1078
+ *
1079
+ * If the anchor is not found, the signature field will be added at a default position (centered at the bottom of the last page).
1080
+ *
1081
+ * Note: Ensure that the input PDF contains the anchor defined by `anchorText` for the signature field to be positioned correctly. Otherwise, it will be added at a default position.
1082
+ */
1083
+ async addSignatureFieldSignatureDebtorRaw(pdf, fieldName = "SignatureDebtor", anchorText = "__SIG_DEBTOR_ANCHOR__") {
1084
+ return await addSignatureFieldUsingAnchor(pdf, fieldName, anchorText);
1085
+ }
1086
+ };
1087
+ NestjsPdfService = __decorate([(0, _nestjs_common.Injectable)(), __decorateMetadata("design:paramtypes", [typeof PuppeteerService === "undefined" ? Object : PuppeteerService])], NestjsPdfService);
1088
+ //#endregion
1089
+ //#region node_modules/.pnpm/dotenv@17.4.1/node_modules/dotenv/lib/main.js
1090
+ var require_main$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1091
+ const fs$1 = require("fs");
1092
+ const path = require("path");
1093
+ const os = require("os");
1094
+ const crypto = require("crypto");
1095
+ const TIPS = [
1096
+ "◈ encrypted .env [www.dotenvx.com]",
1097
+ "◈ secrets for agents [www.dotenvx.com]",
1098
+ "⌁ auth for agents [www.vestauth.com]",
1099
+ "⌘ custom filepath { path: '/custom/path/.env' }",
1100
+ "⌘ enable debugging { debug: true }",
1101
+ "⌘ override existing { override: true }",
1102
+ "⌘ suppress logs { quiet: true }",
1103
+ "⌘ multiple files { path: ['.env.local', '.env'] }"
1104
+ ];
1105
+ function _getRandomTip() {
1106
+ return TIPS[Math.floor(Math.random() * TIPS.length)];
1107
+ }
1108
+ function parseBoolean(value) {
1109
+ if (typeof value === "string") return ![
1110
+ "false",
1111
+ "0",
1112
+ "no",
1113
+ "off",
1114
+ ""
1115
+ ].includes(value.toLowerCase());
1116
+ return Boolean(value);
1117
+ }
1118
+ function supportsAnsi() {
1119
+ return process.stdout.isTTY;
1120
+ }
1121
+ function dim(text) {
1122
+ return supportsAnsi() ? `\x1b[2m${text}\x1b[0m` : text;
1123
+ }
1124
+ const LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;
1125
+ function parse(src) {
1126
+ const obj = {};
1127
+ let lines = src.toString();
1128
+ lines = lines.replace(/\r\n?/gm, "\n");
1129
+ let match;
1130
+ while ((match = LINE.exec(lines)) != null) {
1131
+ const key = match[1];
1132
+ let value = match[2] || "";
1133
+ value = value.trim();
1134
+ const maybeQuote = value[0];
1135
+ value = value.replace(/^(['"`])([\s\S]*)\1$/gm, "$2");
1136
+ if (maybeQuote === "\"") {
1137
+ value = value.replace(/\\n/g, "\n");
1138
+ value = value.replace(/\\r/g, "\r");
1139
+ }
1140
+ obj[key] = value;
1141
+ }
1142
+ return obj;
1143
+ }
1144
+ function _parseVault(options) {
1145
+ options = options || {};
1146
+ const vaultPath = _vaultPath(options);
1147
+ options.path = vaultPath;
1148
+ const result = DotenvModule.configDotenv(options);
1149
+ if (!result.parsed) {
1150
+ const err = /* @__PURE__ */ new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
1151
+ err.code = "MISSING_DATA";
1152
+ throw err;
1153
+ }
1154
+ const keys = _dotenvKey(options).split(",");
1155
+ const length = keys.length;
1156
+ let decrypted;
1157
+ for (let i = 0; i < length; i++) try {
1158
+ const attrs = _instructions(result, keys[i].trim());
1159
+ decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
1160
+ break;
1161
+ } catch (error) {
1162
+ if (i + 1 >= length) throw error;
1163
+ }
1164
+ return DotenvModule.parse(decrypted);
1165
+ }
1166
+ function _warn(message) {
1167
+ console.error(`⚠ ${message}`);
1168
+ }
1169
+ function _debug(message) {
1170
+ console.log(`┆ ${message}`);
1171
+ }
1172
+ function _log(message) {
1173
+ console.log(`◇ ${message}`);
1174
+ }
1175
+ function _dotenvKey(options) {
1176
+ if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) return options.DOTENV_KEY;
1177
+ if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) return process.env.DOTENV_KEY;
1178
+ return "";
1179
+ }
1180
+ function _instructions(result, dotenvKey) {
1181
+ let uri;
1182
+ try {
1183
+ uri = new URL(dotenvKey);
1184
+ } catch (error) {
1185
+ if (error.code === "ERR_INVALID_URL") {
1186
+ const err = /* @__PURE__ */ new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");
1187
+ err.code = "INVALID_DOTENV_KEY";
1188
+ throw err;
1189
+ }
1190
+ throw error;
1191
+ }
1192
+ const key = uri.password;
1193
+ if (!key) {
1194
+ const err = /* @__PURE__ */ new Error("INVALID_DOTENV_KEY: Missing key part");
1195
+ err.code = "INVALID_DOTENV_KEY";
1196
+ throw err;
1197
+ }
1198
+ const environment = uri.searchParams.get("environment");
1199
+ if (!environment) {
1200
+ const err = /* @__PURE__ */ new Error("INVALID_DOTENV_KEY: Missing environment part");
1201
+ err.code = "INVALID_DOTENV_KEY";
1202
+ throw err;
1203
+ }
1204
+ const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
1205
+ const ciphertext = result.parsed[environmentKey];
1206
+ if (!ciphertext) {
1207
+ const err = /* @__PURE__ */ new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
1208
+ err.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
1209
+ throw err;
1210
+ }
1211
+ return {
1212
+ ciphertext,
1213
+ key
1214
+ };
1215
+ }
1216
+ function _vaultPath(options) {
1217
+ let possibleVaultPath = null;
1218
+ if (options && options.path && options.path.length > 0) if (Array.isArray(options.path)) {
1219
+ for (const filepath of options.path) if (fs$1.existsSync(filepath)) possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
1220
+ } else possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
1221
+ else possibleVaultPath = path.resolve(process.cwd(), ".env.vault");
1222
+ if (fs$1.existsSync(possibleVaultPath)) return possibleVaultPath;
1223
+ return null;
1224
+ }
1225
+ function _resolveHome(envPath) {
1226
+ return envPath[0] === "~" ? path.join(os.homedir(), envPath.slice(1)) : envPath;
1227
+ }
1228
+ function _configVault(options) {
1229
+ const debug = parseBoolean(process.env.DOTENV_CONFIG_DEBUG || options && options.debug);
1230
+ const quiet = parseBoolean(process.env.DOTENV_CONFIG_QUIET || options && options.quiet);
1231
+ if (debug || !quiet) _log("loading env from encrypted .env.vault");
1232
+ const parsed = DotenvModule._parseVault(options);
1233
+ let processEnv = process.env;
1234
+ if (options && options.processEnv != null) processEnv = options.processEnv;
1235
+ DotenvModule.populate(processEnv, parsed, options);
1236
+ return { parsed };
1237
+ }
1238
+ function configDotenv(options) {
1239
+ const dotenvPath = path.resolve(process.cwd(), ".env");
1240
+ let encoding = "utf8";
1241
+ let processEnv = process.env;
1242
+ if (options && options.processEnv != null) processEnv = options.processEnv;
1243
+ let debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || options && options.debug);
1244
+ let quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || options && options.quiet);
1245
+ if (options && options.encoding) encoding = options.encoding;
1246
+ else if (debug) _debug("no encoding is specified (UTF-8 is used by default)");
1247
+ let optionPaths = [dotenvPath];
1248
+ if (options && options.path) if (!Array.isArray(options.path)) optionPaths = [_resolveHome(options.path)];
1249
+ else {
1250
+ optionPaths = [];
1251
+ for (const filepath of options.path) optionPaths.push(_resolveHome(filepath));
1252
+ }
1253
+ let lastError;
1254
+ const parsedAll = {};
1255
+ for (const path of optionPaths) try {
1256
+ const parsed = DotenvModule.parse(fs$1.readFileSync(path, { encoding }));
1257
+ DotenvModule.populate(parsedAll, parsed, options);
1258
+ } catch (e) {
1259
+ if (debug) _debug(`failed to load ${path} ${e.message}`);
1260
+ lastError = e;
1261
+ }
1262
+ const populated = DotenvModule.populate(processEnv, parsedAll, options);
1263
+ debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || debug);
1264
+ quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || quiet);
1265
+ if (debug || !quiet) {
1266
+ const keysCount = Object.keys(populated).length;
1267
+ const shortPaths = [];
1268
+ for (const filePath of optionPaths) try {
1269
+ const relative = path.relative(process.cwd(), filePath);
1270
+ shortPaths.push(relative);
1271
+ } catch (e) {
1272
+ if (debug) _debug(`failed to load ${filePath} ${e.message}`);
1273
+ lastError = e;
1274
+ }
1275
+ _log(`injected env (${keysCount}) from ${shortPaths.join(",")} ${dim(`// tip: ${_getRandomTip()}`)}`);
1276
+ }
1277
+ if (lastError) return {
1278
+ parsed: parsedAll,
1279
+ error: lastError
1280
+ };
1281
+ else return { parsed: parsedAll };
1282
+ }
1283
+ function config(options) {
1284
+ if (_dotenvKey(options).length === 0) return DotenvModule.configDotenv(options);
1285
+ const vaultPath = _vaultPath(options);
1286
+ if (!vaultPath) {
1287
+ _warn(`you set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}`);
1288
+ return DotenvModule.configDotenv(options);
1289
+ }
1290
+ return DotenvModule._configVault(options);
1291
+ }
1292
+ function decrypt(encrypted, keyStr) {
1293
+ const key = Buffer.from(keyStr.slice(-64), "hex");
1294
+ let ciphertext = Buffer.from(encrypted, "base64");
1295
+ const nonce = ciphertext.subarray(0, 12);
1296
+ const authTag = ciphertext.subarray(-16);
1297
+ ciphertext = ciphertext.subarray(12, -16);
1298
+ try {
1299
+ const aesgcm = crypto.createDecipheriv("aes-256-gcm", key, nonce);
1300
+ aesgcm.setAuthTag(authTag);
1301
+ return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
1302
+ } catch (error) {
1303
+ const isRange = error instanceof RangeError;
1304
+ const invalidKeyLength = error.message === "Invalid key length";
1305
+ const decryptionFailed = error.message === "Unsupported state or unable to authenticate data";
1306
+ if (isRange || invalidKeyLength) {
1307
+ const err = /* @__PURE__ */ new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
1308
+ err.code = "INVALID_DOTENV_KEY";
1309
+ throw err;
1310
+ } else if (decryptionFailed) {
1311
+ const err = /* @__PURE__ */ new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
1312
+ err.code = "DECRYPTION_FAILED";
1313
+ throw err;
1314
+ } else throw error;
1315
+ }
1316
+ }
1317
+ function populate(processEnv, parsed, options = {}) {
1318
+ const debug = Boolean(options && options.debug);
1319
+ const override = Boolean(options && options.override);
1320
+ const populated = {};
1321
+ if (typeof parsed !== "object") {
1322
+ const err = /* @__PURE__ */ new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
1323
+ err.code = "OBJECT_REQUIRED";
1324
+ throw err;
1325
+ }
1326
+ for (const key of Object.keys(parsed)) if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
1327
+ if (override === true) {
1328
+ processEnv[key] = parsed[key];
1329
+ populated[key] = parsed[key];
1330
+ }
1331
+ if (debug) if (override === true) _debug(`"${key}" is already defined and WAS overwritten`);
1332
+ else _debug(`"${key}" is already defined and was NOT overwritten`);
1333
+ } else {
1334
+ processEnv[key] = parsed[key];
1335
+ populated[key] = parsed[key];
1336
+ }
1337
+ return populated;
1338
+ }
1339
+ const DotenvModule = {
1340
+ configDotenv,
1341
+ _configVault,
1342
+ _parseVault,
1343
+ config,
1344
+ decrypt,
1345
+ parse,
1346
+ populate
1347
+ };
1348
+ module.exports.configDotenv = DotenvModule.configDotenv;
1349
+ module.exports._configVault = DotenvModule._configVault;
1350
+ module.exports._parseVault = DotenvModule._parseVault;
1351
+ module.exports.config = DotenvModule.config;
1352
+ module.exports.decrypt = DotenvModule.decrypt;
1353
+ module.exports.parse = DotenvModule.parse;
1354
+ module.exports.populate = DotenvModule.populate;
1355
+ module.exports = DotenvModule;
1356
+ }));
1357
+ //#endregion
1358
+ //#region node_modules/.pnpm/dotenv-expand@12.0.3/node_modules/dotenv-expand/lib/main.js
1359
+ var require_main = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1360
+ function _resolveEscapeSequences(value) {
1361
+ return value.replace(/\\\$/g, "$");
1362
+ }
1363
+ function expandValue(value, processEnv, runningParsed) {
1364
+ const env = {
1365
+ ...runningParsed,
1366
+ ...processEnv
1367
+ };
1368
+ const regex = /(?<!\\)\${([^{}]+)}|(?<!\\)\$([A-Za-z_][A-Za-z0-9_]*)/g;
1369
+ let result = value;
1370
+ let match;
1371
+ const seen = /* @__PURE__ */ new Set();
1372
+ while ((match = regex.exec(result)) !== null) {
1373
+ seen.add(result);
1374
+ const [template, bracedExpression, unbracedExpression] = match;
1375
+ const expression = bracedExpression || unbracedExpression;
1376
+ const opMatch = expression.match(/(:\+|\+|:-|-)/);
1377
+ const splitter = opMatch ? opMatch[0] : null;
1378
+ const r = expression.split(splitter);
1379
+ let defaultValue;
1380
+ let value;
1381
+ const key = r.shift();
1382
+ if ([":+", "+"].includes(splitter)) {
1383
+ defaultValue = env[key] ? r.join(splitter) : "";
1384
+ value = null;
1385
+ } else {
1386
+ defaultValue = r.join(splitter);
1387
+ value = env[key];
1388
+ }
1389
+ if (value) if (seen.has(value)) result = result.replace(template, defaultValue);
1390
+ else result = result.replace(template, value);
1391
+ else result = result.replace(template, defaultValue);
1392
+ if (result === runningParsed[key]) break;
1393
+ regex.lastIndex = 0;
1394
+ }
1395
+ return result;
1396
+ }
1397
+ function expand(options) {
1398
+ const runningParsed = {};
1399
+ let processEnv = process.env;
1400
+ if (options && options.processEnv != null) processEnv = options.processEnv;
1401
+ for (const key in options.parsed) {
1402
+ let value = options.parsed[key];
1403
+ if (processEnv[key] && processEnv[key] !== value) value = processEnv[key];
1404
+ else value = expandValue(value, processEnv, runningParsed);
1405
+ options.parsed[key] = _resolveEscapeSequences(value);
1406
+ runningParsed[key] = _resolveEscapeSequences(value);
1407
+ }
1408
+ for (const processKey in options.parsed) processEnv[processKey] = options.parsed[processKey];
1409
+ return options;
1410
+ }
1411
+ module.exports.expand = expand;
1412
+ }));
1413
+ //#endregion
1414
+ //#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/config.constants.js
1415
+ var require_config_constants = /* @__PURE__ */ __commonJSMin(((exports) => {
1416
+ Object.defineProperty(exports, "__esModule", { value: true });
1417
+ exports.AS_PROVIDER_METHOD_KEY = exports.VALIDATED_ENV_PROPNAME = exports.PARTIAL_CONFIGURATION_PROPNAME = exports.PARTIAL_CONFIGURATION_KEY = exports.VALIDATED_ENV_LOADER = exports.CONFIGURATION_LOADER = exports.CONFIGURATION_TOKEN = exports.CONFIGURATION_SERVICE_TOKEN = void 0;
1418
+ /**
1419
+ * Injection tokens
1420
+ */
1421
+ exports.CONFIGURATION_SERVICE_TOKEN = Symbol("CONFIG_SERVICE");
1422
+ exports.CONFIGURATION_TOKEN = "CONFIGURATION_TOKEN";
1423
+ exports.CONFIGURATION_LOADER = "CONFIGURATION_LOADER";
1424
+ exports.VALIDATED_ENV_LOADER = "VALIDATED_ENV_LOADER";
1425
+ exports.PARTIAL_CONFIGURATION_KEY = "PARTIAL_CONFIGURATION_KEY";
1426
+ exports.PARTIAL_CONFIGURATION_PROPNAME = "KEY";
1427
+ exports.VALIDATED_ENV_PROPNAME = "_PROCESS_ENV_VALIDATED";
1428
+ exports.AS_PROVIDER_METHOD_KEY = "asProvider";
1429
+ }));
1430
+ //#endregion
1431
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isArray.js
1432
+ var require_isArray = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1433
+ module.exports = Array.isArray;
1434
+ }));
1435
+ //#endregion
1436
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_freeGlobal.js
1437
+ var require__freeGlobal = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1438
+ module.exports = typeof global == "object" && global && global.Object === Object && global;
1439
+ }));
1440
+ //#endregion
1441
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_root.js
1442
+ var require__root = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1443
+ var freeGlobal = require__freeGlobal();
1444
+ /** Detect free variable `self`. */
1445
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
1446
+ module.exports = freeGlobal || freeSelf || Function("return this")();
1447
+ }));
1448
+ //#endregion
1449
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_Symbol.js
1450
+ var require__Symbol = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1451
+ module.exports = require__root().Symbol;
1452
+ }));
1453
+ //#endregion
1454
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getRawTag.js
1455
+ var require__getRawTag = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1456
+ var Symbol = require__Symbol();
1457
+ /** Used for built-in method references. */
1458
+ var objectProto = Object.prototype;
1459
+ /** Used to check objects for own properties. */
1460
+ var hasOwnProperty = objectProto.hasOwnProperty;
1461
+ /**
1462
+ * Used to resolve the
1463
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
1464
+ * of values.
1465
+ */
1466
+ var nativeObjectToString = objectProto.toString;
1467
+ /** Built-in value references. */
1468
+ var symToStringTag = Symbol ? Symbol.toStringTag : void 0;
1469
+ /**
1470
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
1471
+ *
1472
+ * @private
1473
+ * @param {*} value The value to query.
1474
+ * @returns {string} Returns the raw `toStringTag`.
1475
+ */
1476
+ function getRawTag(value) {
1477
+ var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
1478
+ try {
1479
+ value[symToStringTag] = void 0;
1480
+ var unmasked = true;
1481
+ } catch (e) {}
1482
+ var result = nativeObjectToString.call(value);
1483
+ if (unmasked) if (isOwn) value[symToStringTag] = tag;
1484
+ else delete value[symToStringTag];
1485
+ return result;
1486
+ }
1487
+ module.exports = getRawTag;
1488
+ }));
1489
+ //#endregion
1490
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_objectToString.js
1491
+ var require__objectToString = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1492
+ /**
1493
+ * Used to resolve the
1494
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
1495
+ * of values.
1496
+ */
1497
+ var nativeObjectToString = Object.prototype.toString;
1498
+ /**
1499
+ * Converts `value` to a string using `Object.prototype.toString`.
1500
+ *
1501
+ * @private
1502
+ * @param {*} value The value to convert.
1503
+ * @returns {string} Returns the converted string.
1504
+ */
1505
+ function objectToString(value) {
1506
+ return nativeObjectToString.call(value);
1507
+ }
1508
+ module.exports = objectToString;
1509
+ }));
1510
+ //#endregion
1511
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseGetTag.js
1512
+ var require__baseGetTag = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1513
+ var Symbol = require__Symbol();
1514
+ var getRawTag = require__getRawTag();
1515
+ var objectToString = require__objectToString();
1516
+ /** `Object#toString` result references. */
1517
+ var nullTag = "[object Null]";
1518
+ var undefinedTag = "[object Undefined]";
1519
+ /** Built-in value references. */
1520
+ var symToStringTag = Symbol ? Symbol.toStringTag : void 0;
1521
+ /**
1522
+ * The base implementation of `getTag` without fallbacks for buggy environments.
1523
+ *
1524
+ * @private
1525
+ * @param {*} value The value to query.
1526
+ * @returns {string} Returns the `toStringTag`.
1527
+ */
1528
+ function baseGetTag(value) {
1529
+ if (value == null) return value === void 0 ? undefinedTag : nullTag;
1530
+ return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
1531
+ }
1532
+ module.exports = baseGetTag;
1533
+ }));
1534
+ //#endregion
1535
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isObjectLike.js
1536
+ var require_isObjectLike = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1537
+ /**
1538
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
1539
+ * and has a `typeof` result of "object".
1540
+ *
1541
+ * @static
1542
+ * @memberOf _
1543
+ * @since 4.0.0
1544
+ * @category Lang
1545
+ * @param {*} value The value to check.
1546
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
1547
+ * @example
1548
+ *
1549
+ * _.isObjectLike({});
1550
+ * // => true
1551
+ *
1552
+ * _.isObjectLike([1, 2, 3]);
1553
+ * // => true
1554
+ *
1555
+ * _.isObjectLike(_.noop);
1556
+ * // => false
1557
+ *
1558
+ * _.isObjectLike(null);
1559
+ * // => false
1560
+ */
1561
+ function isObjectLike(value) {
1562
+ return value != null && typeof value == "object";
1563
+ }
1564
+ module.exports = isObjectLike;
1565
+ }));
1566
+ //#endregion
1567
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isSymbol.js
1568
+ var require_isSymbol = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1569
+ var baseGetTag = require__baseGetTag();
1570
+ var isObjectLike = require_isObjectLike();
1571
+ /** `Object#toString` result references. */
1572
+ var symbolTag = "[object Symbol]";
1573
+ /**
1574
+ * Checks if `value` is classified as a `Symbol` primitive or object.
1575
+ *
1576
+ * @static
1577
+ * @memberOf _
1578
+ * @since 4.0.0
1579
+ * @category Lang
1580
+ * @param {*} value The value to check.
1581
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
1582
+ * @example
1583
+ *
1584
+ * _.isSymbol(Symbol.iterator);
1585
+ * // => true
1586
+ *
1587
+ * _.isSymbol('abc');
1588
+ * // => false
1589
+ */
1590
+ function isSymbol(value) {
1591
+ return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
1592
+ }
1593
+ module.exports = isSymbol;
1594
+ }));
1595
+ //#endregion
1596
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isKey.js
1597
+ var require__isKey = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1598
+ var isArray = require_isArray();
1599
+ var isSymbol = require_isSymbol();
1600
+ /** Used to match property names within property paths. */
1601
+ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
1602
+ var reIsPlainProp = /^\w*$/;
1603
+ /**
1604
+ * Checks if `value` is a property name and not a property path.
1605
+ *
1606
+ * @private
1607
+ * @param {*} value The value to check.
1608
+ * @param {Object} [object] The object to query keys on.
1609
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
1610
+ */
1611
+ function isKey(value, object) {
1612
+ if (isArray(value)) return false;
1613
+ var type = typeof value;
1614
+ if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) return true;
1615
+ return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
1616
+ }
1617
+ module.exports = isKey;
1618
+ }));
1619
+ //#endregion
1620
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isObject.js
1621
+ var require_isObject = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1622
+ /**
1623
+ * Checks if `value` is the
1624
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
1625
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
1626
+ *
1627
+ * @static
1628
+ * @memberOf _
1629
+ * @since 0.1.0
1630
+ * @category Lang
1631
+ * @param {*} value The value to check.
1632
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
1633
+ * @example
1634
+ *
1635
+ * _.isObject({});
1636
+ * // => true
1637
+ *
1638
+ * _.isObject([1, 2, 3]);
1639
+ * // => true
1640
+ *
1641
+ * _.isObject(_.noop);
1642
+ * // => true
1643
+ *
1644
+ * _.isObject(null);
1645
+ * // => false
1646
+ */
1647
+ function isObject(value) {
1648
+ var type = typeof value;
1649
+ return value != null && (type == "object" || type == "function");
1650
+ }
1651
+ module.exports = isObject;
1652
+ }));
1653
+ //#endregion
1654
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isFunction.js
1655
+ var require_isFunction = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1656
+ var baseGetTag = require__baseGetTag();
1657
+ var isObject = require_isObject();
1658
+ /** `Object#toString` result references. */
1659
+ var asyncTag = "[object AsyncFunction]";
1660
+ var funcTag = "[object Function]";
1661
+ var genTag = "[object GeneratorFunction]";
1662
+ var proxyTag = "[object Proxy]";
1663
+ /**
1664
+ * Checks if `value` is classified as a `Function` object.
1665
+ *
1666
+ * @static
1667
+ * @memberOf _
1668
+ * @since 0.1.0
1669
+ * @category Lang
1670
+ * @param {*} value The value to check.
1671
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
1672
+ * @example
1673
+ *
1674
+ * _.isFunction(_);
1675
+ * // => true
1676
+ *
1677
+ * _.isFunction(/abc/);
1678
+ * // => false
1679
+ */
1680
+ function isFunction(value) {
1681
+ if (!isObject(value)) return false;
1682
+ var tag = baseGetTag(value);
1683
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
1684
+ }
1685
+ module.exports = isFunction;
1686
+ }));
1687
+ //#endregion
1688
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_coreJsData.js
1689
+ var require__coreJsData = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1690
+ module.exports = require__root()["__core-js_shared__"];
1691
+ }));
1692
+ //#endregion
1693
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isMasked.js
1694
+ var require__isMasked = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1695
+ var coreJsData = require__coreJsData();
1696
+ /** Used to detect methods masquerading as native. */
1697
+ var maskSrcKey = function() {
1698
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
1699
+ return uid ? "Symbol(src)_1." + uid : "";
1700
+ }();
1701
+ /**
1702
+ * Checks if `func` has its source masked.
1703
+ *
1704
+ * @private
1705
+ * @param {Function} func The function to check.
1706
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
1707
+ */
1708
+ function isMasked(func) {
1709
+ return !!maskSrcKey && maskSrcKey in func;
1710
+ }
1711
+ module.exports = isMasked;
1712
+ }));
1713
+ //#endregion
1714
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_toSource.js
1715
+ var require__toSource = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1716
+ /** Used to resolve the decompiled source of functions. */
1717
+ var funcToString = Function.prototype.toString;
1718
+ /**
1719
+ * Converts `func` to its source code.
1720
+ *
1721
+ * @private
1722
+ * @param {Function} func The function to convert.
1723
+ * @returns {string} Returns the source code.
1724
+ */
1725
+ function toSource(func) {
1726
+ if (func != null) {
1727
+ try {
1728
+ return funcToString.call(func);
1729
+ } catch (e) {}
1730
+ try {
1731
+ return func + "";
1732
+ } catch (e) {}
1733
+ }
1734
+ return "";
1735
+ }
1736
+ module.exports = toSource;
1737
+ }));
1738
+ //#endregion
1739
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseIsNative.js
1740
+ var require__baseIsNative = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1741
+ var isFunction = require_isFunction();
1742
+ var isMasked = require__isMasked();
1743
+ var isObject = require_isObject();
1744
+ var toSource = require__toSource();
1745
+ /**
1746
+ * Used to match `RegExp`
1747
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
1748
+ */
1749
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
1750
+ /** Used to detect host constructors (Safari). */
1751
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
1752
+ /** Used for built-in method references. */
1753
+ var funcProto = Function.prototype;
1754
+ var objectProto = Object.prototype;
1755
+ /** Used to resolve the decompiled source of functions. */
1756
+ var funcToString = funcProto.toString;
1757
+ /** Used to check objects for own properties. */
1758
+ var hasOwnProperty = objectProto.hasOwnProperty;
1759
+ /** Used to detect if a method is native. */
1760
+ var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
1761
+ /**
1762
+ * The base implementation of `_.isNative` without bad shim checks.
1763
+ *
1764
+ * @private
1765
+ * @param {*} value The value to check.
1766
+ * @returns {boolean} Returns `true` if `value` is a native function,
1767
+ * else `false`.
1768
+ */
1769
+ function baseIsNative(value) {
1770
+ if (!isObject(value) || isMasked(value)) return false;
1771
+ return (isFunction(value) ? reIsNative : reIsHostCtor).test(toSource(value));
1772
+ }
1773
+ module.exports = baseIsNative;
1774
+ }));
1775
+ //#endregion
1776
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getValue.js
1777
+ var require__getValue = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1778
+ /**
1779
+ * Gets the value at `key` of `object`.
1780
+ *
1781
+ * @private
1782
+ * @param {Object} [object] The object to query.
1783
+ * @param {string} key The key of the property to get.
1784
+ * @returns {*} Returns the property value.
1785
+ */
1786
+ function getValue(object, key) {
1787
+ return object == null ? void 0 : object[key];
1788
+ }
1789
+ module.exports = getValue;
1790
+ }));
1791
+ //#endregion
1792
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getNative.js
1793
+ var require__getNative = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1794
+ var baseIsNative = require__baseIsNative();
1795
+ var getValue = require__getValue();
1796
+ /**
1797
+ * Gets the native function at `key` of `object`.
1798
+ *
1799
+ * @private
1800
+ * @param {Object} object The object to query.
1801
+ * @param {string} key The key of the method to get.
1802
+ * @returns {*} Returns the function if it's native, else `undefined`.
1803
+ */
1804
+ function getNative(object, key) {
1805
+ var value = getValue(object, key);
1806
+ return baseIsNative(value) ? value : void 0;
1807
+ }
1808
+ module.exports = getNative;
1809
+ }));
1810
+ //#endregion
1811
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_nativeCreate.js
1812
+ var require__nativeCreate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1813
+ module.exports = require__getNative()(Object, "create");
1814
+ }));
1815
+ //#endregion
1816
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashClear.js
1817
+ var require__hashClear = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1818
+ var nativeCreate = require__nativeCreate();
1819
+ /**
1820
+ * Removes all key-value entries from the hash.
1821
+ *
1822
+ * @private
1823
+ * @name clear
1824
+ * @memberOf Hash
1825
+ */
1826
+ function hashClear() {
1827
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
1828
+ this.size = 0;
1829
+ }
1830
+ module.exports = hashClear;
1831
+ }));
1832
+ //#endregion
1833
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashDelete.js
1834
+ var require__hashDelete = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1835
+ /**
1836
+ * Removes `key` and its value from the hash.
1837
+ *
1838
+ * @private
1839
+ * @name delete
1840
+ * @memberOf Hash
1841
+ * @param {Object} hash The hash to modify.
1842
+ * @param {string} key The key of the value to remove.
1843
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1844
+ */
1845
+ function hashDelete(key) {
1846
+ var result = this.has(key) && delete this.__data__[key];
1847
+ this.size -= result ? 1 : 0;
1848
+ return result;
1849
+ }
1850
+ module.exports = hashDelete;
1851
+ }));
1852
+ //#endregion
1853
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashGet.js
1854
+ var require__hashGet = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1855
+ var nativeCreate = require__nativeCreate();
1856
+ /** Used to stand-in for `undefined` hash values. */
1857
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
1858
+ /** Used to check objects for own properties. */
1859
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
1860
+ /**
1861
+ * Gets the hash value for `key`.
1862
+ *
1863
+ * @private
1864
+ * @name get
1865
+ * @memberOf Hash
1866
+ * @param {string} key The key of the value to get.
1867
+ * @returns {*} Returns the entry value.
1868
+ */
1869
+ function hashGet(key) {
1870
+ var data = this.__data__;
1871
+ if (nativeCreate) {
1872
+ var result = data[key];
1873
+ return result === HASH_UNDEFINED ? void 0 : result;
1874
+ }
1875
+ return hasOwnProperty.call(data, key) ? data[key] : void 0;
1876
+ }
1877
+ module.exports = hashGet;
1878
+ }));
1879
+ //#endregion
1880
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashHas.js
1881
+ var require__hashHas = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1882
+ var nativeCreate = require__nativeCreate();
1883
+ /** Used to check objects for own properties. */
1884
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
1885
+ /**
1886
+ * Checks if a hash value for `key` exists.
1887
+ *
1888
+ * @private
1889
+ * @name has
1890
+ * @memberOf Hash
1891
+ * @param {string} key The key of the entry to check.
1892
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1893
+ */
1894
+ function hashHas(key) {
1895
+ var data = this.__data__;
1896
+ return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
1897
+ }
1898
+ module.exports = hashHas;
1899
+ }));
1900
+ //#endregion
1901
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashSet.js
1902
+ var require__hashSet = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1903
+ var nativeCreate = require__nativeCreate();
1904
+ /** Used to stand-in for `undefined` hash values. */
1905
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
1906
+ /**
1907
+ * Sets the hash `key` to `value`.
1908
+ *
1909
+ * @private
1910
+ * @name set
1911
+ * @memberOf Hash
1912
+ * @param {string} key The key of the value to set.
1913
+ * @param {*} value The value to set.
1914
+ * @returns {Object} Returns the hash instance.
1915
+ */
1916
+ function hashSet(key, value) {
1917
+ var data = this.__data__;
1918
+ this.size += this.has(key) ? 0 : 1;
1919
+ data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
1920
+ return this;
1921
+ }
1922
+ module.exports = hashSet;
1923
+ }));
1924
+ //#endregion
1925
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_Hash.js
1926
+ var require__Hash = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1927
+ var hashClear = require__hashClear();
1928
+ var hashDelete = require__hashDelete();
1929
+ var hashGet = require__hashGet();
1930
+ var hashHas = require__hashHas();
1931
+ var hashSet = require__hashSet();
1932
+ /**
1933
+ * Creates a hash object.
1934
+ *
1935
+ * @private
1936
+ * @constructor
1937
+ * @param {Array} [entries] The key-value pairs to cache.
1938
+ */
1939
+ function Hash(entries) {
1940
+ var index = -1, length = entries == null ? 0 : entries.length;
1941
+ this.clear();
1942
+ while (++index < length) {
1943
+ var entry = entries[index];
1944
+ this.set(entry[0], entry[1]);
1945
+ }
1946
+ }
1947
+ Hash.prototype.clear = hashClear;
1948
+ Hash.prototype["delete"] = hashDelete;
1949
+ Hash.prototype.get = hashGet;
1950
+ Hash.prototype.has = hashHas;
1951
+ Hash.prototype.set = hashSet;
1952
+ module.exports = Hash;
1953
+ }));
1954
+ //#endregion
1955
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheClear.js
1956
+ var require__listCacheClear = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1957
+ /**
1958
+ * Removes all key-value entries from the list cache.
1959
+ *
1960
+ * @private
1961
+ * @name clear
1962
+ * @memberOf ListCache
1963
+ */
1964
+ function listCacheClear() {
1965
+ this.__data__ = [];
1966
+ this.size = 0;
1967
+ }
1968
+ module.exports = listCacheClear;
1969
+ }));
1970
+ //#endregion
1971
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/eq.js
1972
+ var require_eq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1973
+ /**
1974
+ * Performs a
1975
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
1976
+ * comparison between two values to determine if they are equivalent.
1977
+ *
1978
+ * @static
1979
+ * @memberOf _
1980
+ * @since 4.0.0
1981
+ * @category Lang
1982
+ * @param {*} value The value to compare.
1983
+ * @param {*} other The other value to compare.
1984
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1985
+ * @example
1986
+ *
1987
+ * var object = { 'a': 1 };
1988
+ * var other = { 'a': 1 };
1989
+ *
1990
+ * _.eq(object, object);
1991
+ * // => true
1992
+ *
1993
+ * _.eq(object, other);
1994
+ * // => false
1995
+ *
1996
+ * _.eq('a', 'a');
1997
+ * // => true
1998
+ *
1999
+ * _.eq('a', Object('a'));
2000
+ * // => false
2001
+ *
2002
+ * _.eq(NaN, NaN);
2003
+ * // => true
2004
+ */
2005
+ function eq(value, other) {
2006
+ return value === other || value !== value && other !== other;
2007
+ }
2008
+ module.exports = eq;
2009
+ }));
2010
+ //#endregion
2011
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_assocIndexOf.js
2012
+ var require__assocIndexOf = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2013
+ var eq = require_eq();
2014
+ /**
2015
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
2016
+ *
2017
+ * @private
2018
+ * @param {Array} array The array to inspect.
2019
+ * @param {*} key The key to search for.
2020
+ * @returns {number} Returns the index of the matched value, else `-1`.
2021
+ */
2022
+ function assocIndexOf(array, key) {
2023
+ var length = array.length;
2024
+ while (length--) if (eq(array[length][0], key)) return length;
2025
+ return -1;
2026
+ }
2027
+ module.exports = assocIndexOf;
2028
+ }));
2029
+ //#endregion
2030
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheDelete.js
2031
+ var require__listCacheDelete = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2032
+ var assocIndexOf = require__assocIndexOf();
2033
+ /** Built-in value references. */
2034
+ var splice = Array.prototype.splice;
2035
+ /**
2036
+ * Removes `key` and its value from the list cache.
2037
+ *
2038
+ * @private
2039
+ * @name delete
2040
+ * @memberOf ListCache
2041
+ * @param {string} key The key of the value to remove.
2042
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
2043
+ */
2044
+ function listCacheDelete(key) {
2045
+ var data = this.__data__, index = assocIndexOf(data, key);
2046
+ if (index < 0) return false;
2047
+ if (index == data.length - 1) data.pop();
2048
+ else splice.call(data, index, 1);
2049
+ --this.size;
2050
+ return true;
2051
+ }
2052
+ module.exports = listCacheDelete;
2053
+ }));
2054
+ //#endregion
2055
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheGet.js
2056
+ var require__listCacheGet = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2057
+ var assocIndexOf = require__assocIndexOf();
2058
+ /**
2059
+ * Gets the list cache value for `key`.
2060
+ *
2061
+ * @private
2062
+ * @name get
2063
+ * @memberOf ListCache
2064
+ * @param {string} key The key of the value to get.
2065
+ * @returns {*} Returns the entry value.
2066
+ */
2067
+ function listCacheGet(key) {
2068
+ var data = this.__data__, index = assocIndexOf(data, key);
2069
+ return index < 0 ? void 0 : data[index][1];
2070
+ }
2071
+ module.exports = listCacheGet;
2072
+ }));
2073
+ //#endregion
2074
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheHas.js
2075
+ var require__listCacheHas = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2076
+ var assocIndexOf = require__assocIndexOf();
2077
+ /**
2078
+ * Checks if a list cache value for `key` exists.
2079
+ *
2080
+ * @private
2081
+ * @name has
2082
+ * @memberOf ListCache
2083
+ * @param {string} key The key of the entry to check.
2084
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
2085
+ */
2086
+ function listCacheHas(key) {
2087
+ return assocIndexOf(this.__data__, key) > -1;
2088
+ }
2089
+ module.exports = listCacheHas;
2090
+ }));
2091
+ //#endregion
2092
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheSet.js
2093
+ var require__listCacheSet = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2094
+ var assocIndexOf = require__assocIndexOf();
2095
+ /**
2096
+ * Sets the list cache `key` to `value`.
2097
+ *
2098
+ * @private
2099
+ * @name set
2100
+ * @memberOf ListCache
2101
+ * @param {string} key The key of the value to set.
2102
+ * @param {*} value The value to set.
2103
+ * @returns {Object} Returns the list cache instance.
2104
+ */
2105
+ function listCacheSet(key, value) {
2106
+ var data = this.__data__, index = assocIndexOf(data, key);
2107
+ if (index < 0) {
2108
+ ++this.size;
2109
+ data.push([key, value]);
2110
+ } else data[index][1] = value;
2111
+ return this;
2112
+ }
2113
+ module.exports = listCacheSet;
2114
+ }));
2115
+ //#endregion
2116
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_ListCache.js
2117
+ var require__ListCache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2118
+ var listCacheClear = require__listCacheClear();
2119
+ var listCacheDelete = require__listCacheDelete();
2120
+ var listCacheGet = require__listCacheGet();
2121
+ var listCacheHas = require__listCacheHas();
2122
+ var listCacheSet = require__listCacheSet();
2123
+ /**
2124
+ * Creates an list cache object.
2125
+ *
2126
+ * @private
2127
+ * @constructor
2128
+ * @param {Array} [entries] The key-value pairs to cache.
2129
+ */
2130
+ function ListCache(entries) {
2131
+ var index = -1, length = entries == null ? 0 : entries.length;
2132
+ this.clear();
2133
+ while (++index < length) {
2134
+ var entry = entries[index];
2135
+ this.set(entry[0], entry[1]);
2136
+ }
2137
+ }
2138
+ ListCache.prototype.clear = listCacheClear;
2139
+ ListCache.prototype["delete"] = listCacheDelete;
2140
+ ListCache.prototype.get = listCacheGet;
2141
+ ListCache.prototype.has = listCacheHas;
2142
+ ListCache.prototype.set = listCacheSet;
2143
+ module.exports = ListCache;
2144
+ }));
2145
+ //#endregion
2146
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_Map.js
2147
+ var require__Map = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2148
+ module.exports = require__getNative()(require__root(), "Map");
2149
+ }));
2150
+ //#endregion
2151
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheClear.js
2152
+ var require__mapCacheClear = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2153
+ var Hash = require__Hash();
2154
+ var ListCache = require__ListCache();
2155
+ var Map = require__Map();
2156
+ /**
2157
+ * Removes all key-value entries from the map.
2158
+ *
2159
+ * @private
2160
+ * @name clear
2161
+ * @memberOf MapCache
2162
+ */
2163
+ function mapCacheClear() {
2164
+ this.size = 0;
2165
+ this.__data__ = {
2166
+ "hash": new Hash(),
2167
+ "map": new (Map || ListCache)(),
2168
+ "string": new Hash()
2169
+ };
2170
+ }
2171
+ module.exports = mapCacheClear;
2172
+ }));
2173
+ //#endregion
2174
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isKeyable.js
2175
+ var require__isKeyable = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2176
+ /**
2177
+ * Checks if `value` is suitable for use as unique object key.
2178
+ *
2179
+ * @private
2180
+ * @param {*} value The value to check.
2181
+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
2182
+ */
2183
+ function isKeyable(value) {
2184
+ var type = typeof value;
2185
+ return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
2186
+ }
2187
+ module.exports = isKeyable;
2188
+ }));
2189
+ //#endregion
2190
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getMapData.js
2191
+ var require__getMapData = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2192
+ var isKeyable = require__isKeyable();
2193
+ /**
2194
+ * Gets the data for `map`.
2195
+ *
2196
+ * @private
2197
+ * @param {Object} map The map to query.
2198
+ * @param {string} key The reference key.
2199
+ * @returns {*} Returns the map data.
2200
+ */
2201
+ function getMapData(map, key) {
2202
+ var data = map.__data__;
2203
+ return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
2204
+ }
2205
+ module.exports = getMapData;
2206
+ }));
2207
+ //#endregion
2208
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheDelete.js
2209
+ var require__mapCacheDelete = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2210
+ var getMapData = require__getMapData();
2211
+ /**
2212
+ * Removes `key` and its value from the map.
2213
+ *
2214
+ * @private
2215
+ * @name delete
2216
+ * @memberOf MapCache
2217
+ * @param {string} key The key of the value to remove.
2218
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
2219
+ */
2220
+ function mapCacheDelete(key) {
2221
+ var result = getMapData(this, key)["delete"](key);
2222
+ this.size -= result ? 1 : 0;
2223
+ return result;
2224
+ }
2225
+ module.exports = mapCacheDelete;
2226
+ }));
2227
+ //#endregion
2228
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheGet.js
2229
+ var require__mapCacheGet = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2230
+ var getMapData = require__getMapData();
2231
+ /**
2232
+ * Gets the map value for `key`.
2233
+ *
2234
+ * @private
2235
+ * @name get
2236
+ * @memberOf MapCache
2237
+ * @param {string} key The key of the value to get.
2238
+ * @returns {*} Returns the entry value.
2239
+ */
2240
+ function mapCacheGet(key) {
2241
+ return getMapData(this, key).get(key);
2242
+ }
2243
+ module.exports = mapCacheGet;
2244
+ }));
2245
+ //#endregion
2246
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheHas.js
2247
+ var require__mapCacheHas = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2248
+ var getMapData = require__getMapData();
2249
+ /**
2250
+ * Checks if a map value for `key` exists.
2251
+ *
2252
+ * @private
2253
+ * @name has
2254
+ * @memberOf MapCache
2255
+ * @param {string} key The key of the entry to check.
2256
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
2257
+ */
2258
+ function mapCacheHas(key) {
2259
+ return getMapData(this, key).has(key);
2260
+ }
2261
+ module.exports = mapCacheHas;
2262
+ }));
2263
+ //#endregion
2264
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheSet.js
2265
+ var require__mapCacheSet = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2266
+ var getMapData = require__getMapData();
2267
+ /**
2268
+ * Sets the map `key` to `value`.
2269
+ *
2270
+ * @private
2271
+ * @name set
2272
+ * @memberOf MapCache
2273
+ * @param {string} key The key of the value to set.
2274
+ * @param {*} value The value to set.
2275
+ * @returns {Object} Returns the map cache instance.
2276
+ */
2277
+ function mapCacheSet(key, value) {
2278
+ var data = getMapData(this, key), size = data.size;
2279
+ data.set(key, value);
2280
+ this.size += data.size == size ? 0 : 1;
2281
+ return this;
2282
+ }
2283
+ module.exports = mapCacheSet;
2284
+ }));
2285
+ //#endregion
2286
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_MapCache.js
2287
+ var require__MapCache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2288
+ var mapCacheClear = require__mapCacheClear();
2289
+ var mapCacheDelete = require__mapCacheDelete();
2290
+ var mapCacheGet = require__mapCacheGet();
2291
+ var mapCacheHas = require__mapCacheHas();
2292
+ var mapCacheSet = require__mapCacheSet();
2293
+ /**
2294
+ * Creates a map cache object to store key-value pairs.
2295
+ *
2296
+ * @private
2297
+ * @constructor
2298
+ * @param {Array} [entries] The key-value pairs to cache.
2299
+ */
2300
+ function MapCache(entries) {
2301
+ var index = -1, length = entries == null ? 0 : entries.length;
2302
+ this.clear();
2303
+ while (++index < length) {
2304
+ var entry = entries[index];
2305
+ this.set(entry[0], entry[1]);
2306
+ }
2307
+ }
2308
+ MapCache.prototype.clear = mapCacheClear;
2309
+ MapCache.prototype["delete"] = mapCacheDelete;
2310
+ MapCache.prototype.get = mapCacheGet;
2311
+ MapCache.prototype.has = mapCacheHas;
2312
+ MapCache.prototype.set = mapCacheSet;
2313
+ module.exports = MapCache;
2314
+ }));
2315
+ //#endregion
2316
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/memoize.js
2317
+ var require_memoize = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2318
+ var MapCache = require__MapCache();
2319
+ /** Error message constants. */
2320
+ var FUNC_ERROR_TEXT = "Expected a function";
2321
+ /**
2322
+ * Creates a function that memoizes the result of `func`. If `resolver` is
2323
+ * provided, it determines the cache key for storing the result based on the
2324
+ * arguments provided to the memoized function. By default, the first argument
2325
+ * provided to the memoized function is used as the map cache key. The `func`
2326
+ * is invoked with the `this` binding of the memoized function.
2327
+ *
2328
+ * **Note:** The cache is exposed as the `cache` property on the memoized
2329
+ * function. Its creation may be customized by replacing the `_.memoize.Cache`
2330
+ * constructor with one whose instances implement the
2331
+ * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
2332
+ * method interface of `clear`, `delete`, `get`, `has`, and `set`.
2333
+ *
2334
+ * @static
2335
+ * @memberOf _
2336
+ * @since 0.1.0
2337
+ * @category Function
2338
+ * @param {Function} func The function to have its output memoized.
2339
+ * @param {Function} [resolver] The function to resolve the cache key.
2340
+ * @returns {Function} Returns the new memoized function.
2341
+ * @example
2342
+ *
2343
+ * var object = { 'a': 1, 'b': 2 };
2344
+ * var other = { 'c': 3, 'd': 4 };
2345
+ *
2346
+ * var values = _.memoize(_.values);
2347
+ * values(object);
2348
+ * // => [1, 2]
2349
+ *
2350
+ * values(other);
2351
+ * // => [3, 4]
2352
+ *
2353
+ * object.a = 2;
2354
+ * values(object);
2355
+ * // => [1, 2]
2356
+ *
2357
+ * // Modify the result cache.
2358
+ * values.cache.set(object, ['a', 'b']);
2359
+ * values(object);
2360
+ * // => ['a', 'b']
2361
+ *
2362
+ * // Replace `_.memoize.Cache`.
2363
+ * _.memoize.Cache = WeakMap;
2364
+ */
2365
+ function memoize(func, resolver) {
2366
+ if (typeof func != "function" || resolver != null && typeof resolver != "function") throw new TypeError(FUNC_ERROR_TEXT);
2367
+ var memoized = function() {
2368
+ var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
2369
+ if (cache.has(key)) return cache.get(key);
2370
+ var result = func.apply(this, args);
2371
+ memoized.cache = cache.set(key, result) || cache;
2372
+ return result;
2373
+ };
2374
+ memoized.cache = new (memoize.Cache || MapCache)();
2375
+ return memoized;
2376
+ }
2377
+ memoize.Cache = MapCache;
2378
+ module.exports = memoize;
2379
+ }));
2380
+ //#endregion
2381
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_memoizeCapped.js
2382
+ var require__memoizeCapped = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2383
+ var memoize = require_memoize();
2384
+ /** Used as the maximum memoize cache size. */
2385
+ var MAX_MEMOIZE_SIZE = 500;
2386
+ /**
2387
+ * A specialized version of `_.memoize` which clears the memoized function's
2388
+ * cache when it exceeds `MAX_MEMOIZE_SIZE`.
2389
+ *
2390
+ * @private
2391
+ * @param {Function} func The function to have its output memoized.
2392
+ * @returns {Function} Returns the new memoized function.
2393
+ */
2394
+ function memoizeCapped(func) {
2395
+ var result = memoize(func, function(key) {
2396
+ if (cache.size === MAX_MEMOIZE_SIZE) cache.clear();
2397
+ return key;
2398
+ });
2399
+ var cache = result.cache;
2400
+ return result;
2401
+ }
2402
+ module.exports = memoizeCapped;
2403
+ }));
2404
+ //#endregion
2405
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_stringToPath.js
2406
+ var require__stringToPath = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2407
+ var memoizeCapped = require__memoizeCapped();
2408
+ /** Used to match property names within property paths. */
2409
+ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
2410
+ /** Used to match backslashes in property paths. */
2411
+ var reEscapeChar = /\\(\\)?/g;
2412
+ module.exports = memoizeCapped(function(string) {
2413
+ var result = [];
2414
+ if (string.charCodeAt(0) === 46) result.push("");
2415
+ string.replace(rePropName, function(match, number, quote, subString) {
2416
+ result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
2417
+ });
2418
+ return result;
2419
+ });
2420
+ }));
2421
+ //#endregion
2422
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_arrayMap.js
2423
+ var require__arrayMap = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2424
+ /**
2425
+ * A specialized version of `_.map` for arrays without support for iteratee
2426
+ * shorthands.
2427
+ *
2428
+ * @private
2429
+ * @param {Array} [array] The array to iterate over.
2430
+ * @param {Function} iteratee The function invoked per iteration.
2431
+ * @returns {Array} Returns the new mapped array.
2432
+ */
2433
+ function arrayMap(array, iteratee) {
2434
+ var index = -1, length = array == null ? 0 : array.length, result = Array(length);
2435
+ while (++index < length) result[index] = iteratee(array[index], index, array);
2436
+ return result;
2437
+ }
2438
+ module.exports = arrayMap;
2439
+ }));
2440
+ //#endregion
2441
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseToString.js
2442
+ var require__baseToString = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2443
+ var Symbol = require__Symbol();
2444
+ var arrayMap = require__arrayMap();
2445
+ var isArray = require_isArray();
2446
+ var isSymbol = require_isSymbol();
2447
+ /** Used as references for various `Number` constants. */
2448
+ var INFINITY = Infinity;
2449
+ /** Used to convert symbols to primitives and strings. */
2450
+ var symbolProto = Symbol ? Symbol.prototype : void 0;
2451
+ var symbolToString = symbolProto ? symbolProto.toString : void 0;
2452
+ /**
2453
+ * The base implementation of `_.toString` which doesn't convert nullish
2454
+ * values to empty strings.
2455
+ *
2456
+ * @private
2457
+ * @param {*} value The value to process.
2458
+ * @returns {string} Returns the string.
2459
+ */
2460
+ function baseToString(value) {
2461
+ if (typeof value == "string") return value;
2462
+ if (isArray(value)) return arrayMap(value, baseToString) + "";
2463
+ if (isSymbol(value)) return symbolToString ? symbolToString.call(value) : "";
2464
+ var result = value + "";
2465
+ return result == "0" && 1 / value == -INFINITY ? "-0" : result;
2466
+ }
2467
+ module.exports = baseToString;
2468
+ }));
2469
+ //#endregion
2470
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/toString.js
2471
+ var require_toString = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2472
+ var baseToString = require__baseToString();
2473
+ /**
2474
+ * Converts `value` to a string. An empty string is returned for `null`
2475
+ * and `undefined` values. The sign of `-0` is preserved.
2476
+ *
2477
+ * @static
2478
+ * @memberOf _
2479
+ * @since 4.0.0
2480
+ * @category Lang
2481
+ * @param {*} value The value to convert.
2482
+ * @returns {string} Returns the converted string.
2483
+ * @example
2484
+ *
2485
+ * _.toString(null);
2486
+ * // => ''
2487
+ *
2488
+ * _.toString(-0);
2489
+ * // => '-0'
2490
+ *
2491
+ * _.toString([1, 2, 3]);
2492
+ * // => '1,2,3'
2493
+ */
2494
+ function toString(value) {
2495
+ return value == null ? "" : baseToString(value);
2496
+ }
2497
+ module.exports = toString;
2498
+ }));
2499
+ //#endregion
2500
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_castPath.js
2501
+ var require__castPath = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2502
+ var isArray = require_isArray();
2503
+ var isKey = require__isKey();
2504
+ var stringToPath = require__stringToPath();
2505
+ var toString = require_toString();
2506
+ /**
2507
+ * Casts `value` to a path array if it's not one.
2508
+ *
2509
+ * @private
2510
+ * @param {*} value The value to inspect.
2511
+ * @param {Object} [object] The object to query keys on.
2512
+ * @returns {Array} Returns the cast property path array.
2513
+ */
2514
+ function castPath(value, object) {
2515
+ if (isArray(value)) return value;
2516
+ return isKey(value, object) ? [value] : stringToPath(toString(value));
2517
+ }
2518
+ module.exports = castPath;
2519
+ }));
2520
+ //#endregion
2521
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_toKey.js
2522
+ var require__toKey = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2523
+ var isSymbol = require_isSymbol();
2524
+ /** Used as references for various `Number` constants. */
2525
+ var INFINITY = Infinity;
2526
+ /**
2527
+ * Converts `value` to a string key if it's not a string or symbol.
2528
+ *
2529
+ * @private
2530
+ * @param {*} value The value to inspect.
2531
+ * @returns {string|symbol} Returns the key.
2532
+ */
2533
+ function toKey(value) {
2534
+ if (typeof value == "string" || isSymbol(value)) return value;
2535
+ var result = value + "";
2536
+ return result == "0" && 1 / value == -INFINITY ? "-0" : result;
2537
+ }
2538
+ module.exports = toKey;
2539
+ }));
2540
+ //#endregion
2541
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseGet.js
2542
+ var require__baseGet = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2543
+ var castPath = require__castPath();
2544
+ var toKey = require__toKey();
2545
+ /**
2546
+ * The base implementation of `_.get` without support for default values.
2547
+ *
2548
+ * @private
2549
+ * @param {Object} object The object to query.
2550
+ * @param {Array|string} path The path of the property to get.
2551
+ * @returns {*} Returns the resolved value.
2552
+ */
2553
+ function baseGet(object, path) {
2554
+ path = castPath(path, object);
2555
+ var index = 0, length = path.length;
2556
+ while (object != null && index < length) object = object[toKey(path[index++])];
2557
+ return index && index == length ? object : void 0;
2558
+ }
2559
+ module.exports = baseGet;
2560
+ }));
2561
+ //#endregion
2562
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/get.js
2563
+ var require_get = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2564
+ var baseGet = require__baseGet();
2565
+ /**
2566
+ * Gets the value at `path` of `object`. If the resolved value is
2567
+ * `undefined`, the `defaultValue` is returned in its place.
2568
+ *
2569
+ * @static
2570
+ * @memberOf _
2571
+ * @since 3.7.0
2572
+ * @category Object
2573
+ * @param {Object} object The object to query.
2574
+ * @param {Array|string} path The path of the property to get.
2575
+ * @param {*} [defaultValue] The value returned for `undefined` resolved values.
2576
+ * @returns {*} Returns the resolved value.
2577
+ * @example
2578
+ *
2579
+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };
2580
+ *
2581
+ * _.get(object, 'a[0].b.c');
2582
+ * // => 3
2583
+ *
2584
+ * _.get(object, ['a', '0', 'b', 'c']);
2585
+ * // => 3
2586
+ *
2587
+ * _.get(object, 'a.b.c', 'default');
2588
+ * // => 'default'
2589
+ */
2590
+ function get(object, path, defaultValue) {
2591
+ var result = object == null ? void 0 : baseGet(object, path);
2592
+ return result === void 0 ? defaultValue : result;
2593
+ }
2594
+ module.exports = get;
2595
+ }));
2596
+ //#endregion
2597
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseHas.js
2598
+ var require__baseHas = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2599
+ /** Used to check objects for own properties. */
2600
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
2601
+ /**
2602
+ * The base implementation of `_.has` without support for deep paths.
2603
+ *
2604
+ * @private
2605
+ * @param {Object} [object] The object to query.
2606
+ * @param {Array|string} key The key to check.
2607
+ * @returns {boolean} Returns `true` if `key` exists, else `false`.
2608
+ */
2609
+ function baseHas(object, key) {
2610
+ return object != null && hasOwnProperty.call(object, key);
2611
+ }
2612
+ module.exports = baseHas;
2613
+ }));
2614
+ //#endregion
2615
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseIsArguments.js
2616
+ var require__baseIsArguments = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2617
+ var baseGetTag = require__baseGetTag();
2618
+ var isObjectLike = require_isObjectLike();
2619
+ /** `Object#toString` result references. */
2620
+ var argsTag = "[object Arguments]";
2621
+ /**
2622
+ * The base implementation of `_.isArguments`.
2623
+ *
2624
+ * @private
2625
+ * @param {*} value The value to check.
2626
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
2627
+ */
2628
+ function baseIsArguments(value) {
2629
+ return isObjectLike(value) && baseGetTag(value) == argsTag;
2630
+ }
2631
+ module.exports = baseIsArguments;
2632
+ }));
2633
+ //#endregion
2634
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isArguments.js
2635
+ var require_isArguments = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2636
+ var baseIsArguments = require__baseIsArguments();
2637
+ var isObjectLike = require_isObjectLike();
2638
+ /** Used for built-in method references. */
2639
+ var objectProto = Object.prototype;
2640
+ /** Used to check objects for own properties. */
2641
+ var hasOwnProperty = objectProto.hasOwnProperty;
2642
+ /** Built-in value references. */
2643
+ var propertyIsEnumerable = objectProto.propertyIsEnumerable;
2644
+ module.exports = baseIsArguments(function() {
2645
+ return arguments;
2646
+ }()) ? baseIsArguments : function(value) {
2647
+ return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
2648
+ };
2649
+ }));
2650
+ //#endregion
2651
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isIndex.js
2652
+ var require__isIndex = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2653
+ /** Used as references for various `Number` constants. */
2654
+ var MAX_SAFE_INTEGER = 9007199254740991;
2655
+ /** Used to detect unsigned integer values. */
2656
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
2657
+ /**
2658
+ * Checks if `value` is a valid array-like index.
2659
+ *
2660
+ * @private
2661
+ * @param {*} value The value to check.
2662
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
2663
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
2664
+ */
2665
+ function isIndex(value, length) {
2666
+ var type = typeof value;
2667
+ length = length == null ? MAX_SAFE_INTEGER : length;
2668
+ return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
2669
+ }
2670
+ module.exports = isIndex;
2671
+ }));
2672
+ //#endregion
2673
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isLength.js
2674
+ var require_isLength = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2675
+ /** Used as references for various `Number` constants. */
2676
+ var MAX_SAFE_INTEGER = 9007199254740991;
2677
+ /**
2678
+ * Checks if `value` is a valid array-like length.
2679
+ *
2680
+ * **Note:** This method is loosely based on
2681
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
2682
+ *
2683
+ * @static
2684
+ * @memberOf _
2685
+ * @since 4.0.0
2686
+ * @category Lang
2687
+ * @param {*} value The value to check.
2688
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
2689
+ * @example
2690
+ *
2691
+ * _.isLength(3);
2692
+ * // => true
2693
+ *
2694
+ * _.isLength(Number.MIN_VALUE);
2695
+ * // => false
2696
+ *
2697
+ * _.isLength(Infinity);
2698
+ * // => false
2699
+ *
2700
+ * _.isLength('3');
2701
+ * // => false
2702
+ */
2703
+ function isLength(value) {
2704
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
2705
+ }
2706
+ module.exports = isLength;
2707
+ }));
2708
+ //#endregion
2709
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hasPath.js
2710
+ var require__hasPath = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2711
+ var castPath = require__castPath();
2712
+ var isArguments = require_isArguments();
2713
+ var isArray = require_isArray();
2714
+ var isIndex = require__isIndex();
2715
+ var isLength = require_isLength();
2716
+ var toKey = require__toKey();
2717
+ /**
2718
+ * Checks if `path` exists on `object`.
2719
+ *
2720
+ * @private
2721
+ * @param {Object} object The object to query.
2722
+ * @param {Array|string} path The path to check.
2723
+ * @param {Function} hasFunc The function to check properties.
2724
+ * @returns {boolean} Returns `true` if `path` exists, else `false`.
2725
+ */
2726
+ function hasPath(object, path, hasFunc) {
2727
+ path = castPath(path, object);
2728
+ var index = -1, length = path.length, result = false;
2729
+ while (++index < length) {
2730
+ var key = toKey(path[index]);
2731
+ if (!(result = object != null && hasFunc(object, key))) break;
2732
+ object = object[key];
2733
+ }
2734
+ if (result || ++index != length) return result;
2735
+ length = object == null ? 0 : object.length;
2736
+ return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
2737
+ }
2738
+ module.exports = hasPath;
2739
+ }));
2740
+ //#endregion
2741
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/has.js
2742
+ var require_has = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2743
+ var baseHas = require__baseHas();
2744
+ var hasPath = require__hasPath();
2745
+ /**
2746
+ * Checks if `path` is a direct property of `object`.
2747
+ *
2748
+ * @static
2749
+ * @since 0.1.0
2750
+ * @memberOf _
2751
+ * @category Object
2752
+ * @param {Object} object The object to query.
2753
+ * @param {Array|string} path The path to check.
2754
+ * @returns {boolean} Returns `true` if `path` exists, else `false`.
2755
+ * @example
2756
+ *
2757
+ * var object = { 'a': { 'b': 2 } };
2758
+ * var other = _.create({ 'a': _.create({ 'b': 2 }) });
2759
+ *
2760
+ * _.has(object, 'a');
2761
+ * // => true
2762
+ *
2763
+ * _.has(object, 'a.b');
2764
+ * // => true
2765
+ *
2766
+ * _.has(object, ['a', 'b']);
2767
+ * // => true
2768
+ *
2769
+ * _.has(other, 'a');
2770
+ * // => false
2771
+ */
2772
+ function has(object, path) {
2773
+ return object != null && hasPath(object, path, baseHas);
2774
+ }
2775
+ module.exports = has;
2776
+ }));
2777
+ //#endregion
2778
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_defineProperty.js
2779
+ var require__defineProperty = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2780
+ var getNative = require__getNative();
2781
+ module.exports = function() {
2782
+ try {
2783
+ var func = getNative(Object, "defineProperty");
2784
+ func({}, "", {});
2785
+ return func;
2786
+ } catch (e) {}
2787
+ }();
2788
+ }));
2789
+ //#endregion
2790
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseAssignValue.js
2791
+ var require__baseAssignValue = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2792
+ var defineProperty = require__defineProperty();
2793
+ /**
2794
+ * The base implementation of `assignValue` and `assignMergeValue` without
2795
+ * value checks.
2796
+ *
2797
+ * @private
2798
+ * @param {Object} object The object to modify.
2799
+ * @param {string} key The key of the property to assign.
2800
+ * @param {*} value The value to assign.
2801
+ */
2802
+ function baseAssignValue(object, key, value) {
2803
+ if (key == "__proto__" && defineProperty) defineProperty(object, key, {
2804
+ "configurable": true,
2805
+ "enumerable": true,
2806
+ "value": value,
2807
+ "writable": true
2808
+ });
2809
+ else object[key] = value;
2810
+ }
2811
+ module.exports = baseAssignValue;
2812
+ }));
2813
+ //#endregion
2814
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_assignValue.js
2815
+ var require__assignValue = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2816
+ var baseAssignValue = require__baseAssignValue();
2817
+ var eq = require_eq();
2818
+ /** Used to check objects for own properties. */
2819
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
2820
+ /**
2821
+ * Assigns `value` to `key` of `object` if the existing value is not equivalent
2822
+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
2823
+ * for equality comparisons.
2824
+ *
2825
+ * @private
2826
+ * @param {Object} object The object to modify.
2827
+ * @param {string} key The key of the property to assign.
2828
+ * @param {*} value The value to assign.
2829
+ */
2830
+ function assignValue(object, key, value) {
2831
+ var objValue = object[key];
2832
+ if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) baseAssignValue(object, key, value);
2833
+ }
2834
+ module.exports = assignValue;
2835
+ }));
2836
+ //#endregion
2837
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseSet.js
2838
+ var require__baseSet = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2839
+ var assignValue = require__assignValue();
2840
+ var castPath = require__castPath();
2841
+ var isIndex = require__isIndex();
2842
+ var isObject = require_isObject();
2843
+ var toKey = require__toKey();
2844
+ /**
2845
+ * The base implementation of `_.set`.
2846
+ *
2847
+ * @private
2848
+ * @param {Object} object The object to modify.
2849
+ * @param {Array|string} path The path of the property to set.
2850
+ * @param {*} value The value to set.
2851
+ * @param {Function} [customizer] The function to customize path creation.
2852
+ * @returns {Object} Returns `object`.
2853
+ */
2854
+ function baseSet(object, path, value, customizer) {
2855
+ if (!isObject(object)) return object;
2856
+ path = castPath(path, object);
2857
+ var index = -1, length = path.length, lastIndex = length - 1, nested = object;
2858
+ while (nested != null && ++index < length) {
2859
+ var key = toKey(path[index]), newValue = value;
2860
+ if (key === "__proto__" || key === "constructor" || key === "prototype") return object;
2861
+ if (index != lastIndex) {
2862
+ var objValue = nested[key];
2863
+ newValue = customizer ? customizer(objValue, key, nested) : void 0;
2864
+ if (newValue === void 0) newValue = isObject(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
2865
+ }
2866
+ assignValue(nested, key, newValue);
2867
+ nested = nested[key];
2868
+ }
2869
+ return object;
2870
+ }
2871
+ module.exports = baseSet;
2872
+ }));
2873
+ //#endregion
2874
+ //#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/set.js
2875
+ var require_set = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2876
+ var baseSet = require__baseSet();
2877
+ /**
2878
+ * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
2879
+ * it's created. Arrays are created for missing index properties while objects
2880
+ * are created for all other missing properties. Use `_.setWith` to customize
2881
+ * `path` creation.
2882
+ *
2883
+ * **Note:** This method mutates `object`.
2884
+ *
2885
+ * @static
2886
+ * @memberOf _
2887
+ * @since 3.7.0
2888
+ * @category Object
2889
+ * @param {Object} object The object to modify.
2890
+ * @param {Array|string} path The path of the property to set.
2891
+ * @param {*} value The value to set.
2892
+ * @returns {Object} Returns `object`.
2893
+ * @example
2894
+ *
2895
+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };
2896
+ *
2897
+ * _.set(object, 'a[0].b.c', 4);
2898
+ * console.log(object.a[0].b.c);
2899
+ * // => 4
2900
+ *
2901
+ * _.set(object, ['x', '0', 'y', 'z'], 5);
2902
+ * console.log(object.x[0].y.z);
2903
+ * // => 5
2904
+ */
2905
+ function set(object, path, value) {
2906
+ return object == null ? object : baseSet(object, path, value);
2907
+ }
2908
+ module.exports = set;
2909
+ }));
2910
+ //#endregion
2911
+ //#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/config.service.js
2912
+ var require_config_service = /* @__PURE__ */ __commonJSMin(((exports) => {
2913
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
2914
+ if (k2 === void 0) k2 = k;
2915
+ var desc = Object.getOwnPropertyDescriptor(m, k);
2916
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
2917
+ enumerable: true,
2918
+ get: function() {
2919
+ return m[k];
2920
+ }
2921
+ };
2922
+ Object.defineProperty(o, k2, desc);
2923
+ }) : (function(o, m, k, k2) {
2924
+ if (k2 === void 0) k2 = k;
2925
+ o[k2] = m[k];
2926
+ }));
2927
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
2928
+ Object.defineProperty(o, "default", {
2929
+ enumerable: true,
2930
+ value: v
2931
+ });
2932
+ }) : function(o, v) {
2933
+ o["default"] = v;
2934
+ });
2935
+ var __decorate = exports && exports.__decorate || function(decorators, target, key, desc) {
2936
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2937
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
2938
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2939
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
2940
+ };
2941
+ var __importStar = exports && exports.__importStar || (function() {
2942
+ var ownKeys = function(o) {
2943
+ ownKeys = Object.getOwnPropertyNames || function(o) {
2944
+ var ar = [];
2945
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
2946
+ return ar;
2947
+ };
2948
+ return ownKeys(o);
2949
+ };
2950
+ return function(mod) {
2951
+ if (mod && mod.__esModule) return mod;
2952
+ var result = {};
2953
+ if (mod != null) {
2954
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
2955
+ }
2956
+ __setModuleDefault(result, mod);
2957
+ return result;
2958
+ };
2959
+ })();
2960
+ var __metadata = exports && exports.__metadata || function(k, v) {
2961
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
2962
+ };
2963
+ var __param = exports && exports.__param || function(paramIndex, decorator) {
2964
+ return function(target, key) {
2965
+ decorator(target, key, paramIndex);
2966
+ };
2967
+ };
2968
+ var __importDefault = exports && exports.__importDefault || function(mod) {
2969
+ return mod && mod.__esModule ? mod : { "default": mod };
2970
+ };
2971
+ Object.defineProperty(exports, "__esModule", { value: true });
2972
+ exports.ConfigService = void 0;
2973
+ const common_1$3 = require("@nestjs/common");
2974
+ const shared_utils_1$1 = require("@nestjs/common/utils/shared.utils");
2975
+ const dotenv = __importStar(require_main$1());
2976
+ const fs_1 = __importDefault(require("fs"));
2977
+ const get_1 = __importDefault(require_get());
2978
+ const has_1 = __importDefault(require_has());
2979
+ const set_1 = __importDefault(require_set());
2980
+ const rxjs_1 = require("rxjs");
2981
+ const config_constants_1 = require_config_constants();
2982
+ /**
2983
+ * @publicApi
2984
+ */
2985
+ let ConfigService = class ConfigService {
2986
+ set isCacheEnabled(value) {
2987
+ this._isCacheEnabled = value;
2988
+ }
2989
+ get isCacheEnabled() {
2990
+ return this._isCacheEnabled;
2991
+ }
2992
+ set skipProcessEnv(value) {
2993
+ this._skipProcessEnv = value;
2994
+ }
2995
+ get skipProcessEnv() {
2996
+ return this._skipProcessEnv;
2997
+ }
2998
+ constructor(internalConfig = {}) {
2999
+ this.internalConfig = internalConfig;
3000
+ this.cache = {};
3001
+ this._changes$ = new rxjs_1.Subject();
3002
+ this._skipProcessEnv = false;
3003
+ this._isCacheEnabled = false;
3004
+ this.envFilePaths = [];
3005
+ }
3006
+ /**
3007
+ * Returns a stream of configuration changes.
3008
+ * Each event contains the attribute path, the old value and the new value.
3009
+ */
3010
+ get changes$() {
3011
+ return this._changes$.asObservable();
3012
+ }
3013
+ /**
3014
+ * Get a configuration value (either custom configuration or process environment variable)
3015
+ * based on property path (you can use dot notation to traverse nested object, e.g. "database.host").
3016
+ * It returns a default value if the key does not exist.
3017
+ * @param propertyPath
3018
+ * @param defaultValueOrOptions
3019
+ */
3020
+ get(propertyPath, defaultValueOrOptions, options) {
3021
+ const internalValue = this.getFromInternalConfig(propertyPath);
3022
+ if (!(0, shared_utils_1$1.isUndefined)(internalValue)) return internalValue;
3023
+ const validatedEnvValue = this.getFromValidatedEnv(propertyPath);
3024
+ if (!(0, shared_utils_1$1.isUndefined)(validatedEnvValue)) return validatedEnvValue;
3025
+ const defaultValue = this.isGetOptionsObject(defaultValueOrOptions) && !options ? void 0 : defaultValueOrOptions;
3026
+ if (!this._skipProcessEnv) {
3027
+ const processEnvValue = this.getFromProcessEnv(propertyPath, defaultValue);
3028
+ if (!(0, shared_utils_1$1.isUndefined)(processEnvValue)) return processEnvValue;
3029
+ }
3030
+ return defaultValue;
3031
+ }
3032
+ /**
3033
+ * Get a configuration value (either custom configuration or process environment variable)
3034
+ * based on property path (you can use dot notation to traverse nested object, e.g. "database.host").
3035
+ * It returns a default value if the key does not exist.
3036
+ * If the default value is undefined an exception will be thrown.
3037
+ * @param propertyPath
3038
+ * @param defaultValueOrOptions
3039
+ */
3040
+ getOrThrow(propertyPath, defaultValueOrOptions, options) {
3041
+ const value = this.get(propertyPath, defaultValueOrOptions, options);
3042
+ if ((0, shared_utils_1$1.isUndefined)(value)) throw new TypeError(`Configuration key "${propertyPath.toString()}" does not exist`);
3043
+ return value;
3044
+ }
3045
+ /**
3046
+ * Sets a configuration value based on property path.
3047
+ * @param propertyPath
3048
+ * @param value
3049
+ */
3050
+ set(propertyPath, value) {
3051
+ const oldValue = this.get(propertyPath);
3052
+ (0, set_1.default)(this.internalConfig, propertyPath, value);
3053
+ if (typeof propertyPath === "string") {
3054
+ process.env[propertyPath] = String(value);
3055
+ this.updateInterpolatedEnv(propertyPath, String(value));
3056
+ }
3057
+ if (this.isCacheEnabled) this.setInCacheIfDefined(propertyPath, value);
3058
+ this._changes$.next({
3059
+ path: propertyPath,
3060
+ oldValue,
3061
+ newValue: value
3062
+ });
3063
+ }
3064
+ /**
3065
+ * Sets env file paths from `config.module.ts` to parse.
3066
+ * @param paths
3067
+ */
3068
+ setEnvFilePaths(paths) {
3069
+ this.envFilePaths = paths;
3070
+ }
3071
+ getFromCache(propertyPath, defaultValue) {
3072
+ const cachedValue = (0, get_1.default)(this.cache, propertyPath);
3073
+ return (0, shared_utils_1$1.isUndefined)(cachedValue) ? defaultValue : cachedValue;
3074
+ }
3075
+ getFromValidatedEnv(propertyPath) {
3076
+ return (0, get_1.default)(this.internalConfig[config_constants_1.VALIDATED_ENV_PROPNAME], propertyPath);
3077
+ }
3078
+ getFromProcessEnv(propertyPath, defaultValue) {
3079
+ if (this.isCacheEnabled && (0, has_1.default)(this.cache, propertyPath)) {
3080
+ const cachedValue = this.getFromCache(propertyPath, defaultValue);
3081
+ return !(0, shared_utils_1$1.isUndefined)(cachedValue) ? cachedValue : defaultValue;
3082
+ }
3083
+ const processValue = (0, get_1.default)(process.env, propertyPath);
3084
+ this.setInCacheIfDefined(propertyPath, processValue);
3085
+ return processValue;
3086
+ }
3087
+ getFromInternalConfig(propertyPath) {
3088
+ return (0, get_1.default)(this.internalConfig, propertyPath);
3089
+ }
3090
+ setInCacheIfDefined(propertyPath, value) {
3091
+ if (typeof value === "undefined") return;
3092
+ (0, set_1.default)(this.cache, propertyPath, value);
3093
+ }
3094
+ isGetOptionsObject(options) {
3095
+ return options && options?.infer && Object.keys(options).length === 1;
3096
+ }
3097
+ updateInterpolatedEnv(propertyPath, value) {
3098
+ let config = {};
3099
+ for (const envFilePath of this.envFilePaths) if (fs_1.default.existsSync(envFilePath)) config = Object.assign(dotenv.parse(fs_1.default.readFileSync(envFilePath)), config);
3100
+ const regex = new RegExp(`\\$\\{?${propertyPath}\\}?`, "g");
3101
+ for (const [k, v] of Object.entries(config)) if (regex.test(v)) process.env[k] = v.replace(regex, value);
3102
+ }
3103
+ };
3104
+ exports.ConfigService = ConfigService;
3105
+ exports.ConfigService = ConfigService = __decorate([
3106
+ (0, common_1$3.Injectable)(),
3107
+ __param(0, (0, common_1$3.Optional)()),
3108
+ __param(0, (0, common_1$3.Inject)(config_constants_1.CONFIGURATION_TOKEN)),
3109
+ __metadata("design:paramtypes", [Object])
3110
+ ], ConfigService);
3111
+ }));
3112
+ //#endregion
3113
+ //#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/config-host.module.js
3114
+ var require_config_host_module = /* @__PURE__ */ __commonJSMin(((exports) => {
3115
+ var __decorate = exports && exports.__decorate || function(decorators, target, key, desc) {
3116
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3117
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
3118
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3119
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
3120
+ };
3121
+ Object.defineProperty(exports, "__esModule", { value: true });
3122
+ exports.ConfigHostModule = void 0;
3123
+ const common_1$2 = require("@nestjs/common");
3124
+ const config_constants_1 = require_config_constants();
3125
+ const config_service_1 = require_config_service();
3126
+ /**
3127
+ * @publicApi
3128
+ */
3129
+ let ConfigHostModule = class ConfigHostModule {};
3130
+ exports.ConfigHostModule = ConfigHostModule;
3131
+ exports.ConfigHostModule = ConfigHostModule = __decorate([(0, common_1$2.Global)(), (0, common_1$2.Module)({
3132
+ providers: [{
3133
+ provide: config_constants_1.CONFIGURATION_TOKEN,
3134
+ useFactory: () => ({})
3135
+ }, {
3136
+ provide: config_constants_1.CONFIGURATION_SERVICE_TOKEN,
3137
+ useClass: config_service_1.ConfigService
3138
+ }],
3139
+ exports: [config_constants_1.CONFIGURATION_TOKEN, config_constants_1.CONFIGURATION_SERVICE_TOKEN]
3140
+ })], ConfigHostModule);
3141
+ }));
3142
+ //#endregion
3143
+ //#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/utils/get-config-token.util.js
3144
+ var require_get_config_token_util = /* @__PURE__ */ __commonJSMin(((exports) => {
3145
+ Object.defineProperty(exports, "__esModule", { value: true });
3146
+ exports.getConfigToken = getConfigToken;
3147
+ /**
3148
+ * @publicApi
3149
+ */
3150
+ function getConfigToken(token) {
3151
+ return `CONFIGURATION(${token.toString()})`;
3152
+ }
3153
+ }));
3154
+ //#endregion
3155
+ //#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/utils/create-config-factory.util.js
3156
+ var require_create_config_factory_util = /* @__PURE__ */ __commonJSMin(((exports) => {
3157
+ Object.defineProperty(exports, "__esModule", { value: true });
3158
+ exports.createConfigProvider = createConfigProvider;
3159
+ const get_config_token_util_1 = require_get_config_token_util();
3160
+ const crypto_1 = require("crypto");
3161
+ /**
3162
+ * @publicApi
3163
+ */
3164
+ function createConfigProvider(factory) {
3165
+ return {
3166
+ provide: factory.KEY || (0, get_config_token_util_1.getConfigToken)((0, crypto_1.randomUUID)()),
3167
+ useFactory: factory,
3168
+ inject: []
3169
+ };
3170
+ }
3171
+ }));
3172
+ //#endregion
3173
+ //#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/utils/get-registration-token.util.js
3174
+ var require_get_registration_token_util = /* @__PURE__ */ __commonJSMin(((exports) => {
3175
+ Object.defineProperty(exports, "__esModule", { value: true });
3176
+ exports.getRegistrationToken = getRegistrationToken;
3177
+ const config_constants_1 = require_config_constants();
3178
+ /**
3179
+ * @publicApi
3180
+ */
3181
+ function getRegistrationToken(config) {
3182
+ return config[config_constants_1.PARTIAL_CONFIGURATION_KEY];
3183
+ }
3184
+ }));
3185
+ //#endregion
3186
+ //#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/utils/merge-configs.util.js
3187
+ var require_merge_configs_util = /* @__PURE__ */ __commonJSMin(((exports) => {
3188
+ var __importDefault = exports && exports.__importDefault || function(mod) {
3189
+ return mod && mod.__esModule ? mod : { "default": mod };
3190
+ };
3191
+ Object.defineProperty(exports, "__esModule", { value: true });
3192
+ exports.mergeConfigObject = mergeConfigObject;
3193
+ const set_1 = __importDefault(require_set());
3194
+ /**
3195
+ * @publicApi
3196
+ */
3197
+ function mergeConfigObject(host, partial, token) {
3198
+ if (token) {
3199
+ (0, set_1.default)(host, token, partial);
3200
+ return partial;
3201
+ }
3202
+ Object.assign(host, partial);
3203
+ }
3204
+ }));
3205
+ //#endregion
3206
+ //#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/config.module.js
3207
+ var require_config_module = /* @__PURE__ */ __commonJSMin(((exports) => {
3208
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
3209
+ if (k2 === void 0) k2 = k;
3210
+ var desc = Object.getOwnPropertyDescriptor(m, k);
3211
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
3212
+ enumerable: true,
3213
+ get: function() {
3214
+ return m[k];
3215
+ }
3216
+ };
3217
+ Object.defineProperty(o, k2, desc);
3218
+ }) : (function(o, m, k, k2) {
3219
+ if (k2 === void 0) k2 = k;
3220
+ o[k2] = m[k];
3221
+ }));
3222
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
3223
+ Object.defineProperty(o, "default", {
3224
+ enumerable: true,
3225
+ value: v
3226
+ });
3227
+ }) : function(o, v) {
3228
+ o["default"] = v;
3229
+ });
3230
+ var __decorate = exports && exports.__decorate || function(decorators, target, key, desc) {
3231
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3232
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
3233
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3234
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
3235
+ };
3236
+ var __importStar = exports && exports.__importStar || (function() {
3237
+ var ownKeys = function(o) {
3238
+ ownKeys = Object.getOwnPropertyNames || function(o) {
3239
+ var ar = [];
3240
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
3241
+ return ar;
3242
+ };
3243
+ return ownKeys(o);
3244
+ };
3245
+ return function(mod) {
3246
+ if (mod && mod.__esModule) return mod;
3247
+ var result = {};
3248
+ if (mod != null) {
3249
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
3250
+ }
3251
+ __setModuleDefault(result, mod);
3252
+ return result;
3253
+ };
3254
+ })();
3255
+ var ConfigModule_1;
3256
+ Object.defineProperty(exports, "__esModule", { value: true });
3257
+ exports.ConfigModule = void 0;
3258
+ const common_1$1 = require("@nestjs/common");
3259
+ const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
3260
+ const dotenv = __importStar(require_main$1());
3261
+ const dotenv_expand_1 = require_main();
3262
+ const fs = __importStar(require("fs"));
3263
+ const path_1 = require("path");
3264
+ const config_host_module_1 = require_config_host_module();
3265
+ const config_constants_1 = require_config_constants();
3266
+ const config_service_1 = require_config_service();
3267
+ const create_config_factory_util_1 = require_create_config_factory_util();
3268
+ const get_registration_token_util_1 = require_get_registration_token_util();
3269
+ const merge_configs_util_1 = require_merge_configs_util();
3270
+ /**
3271
+ * @publicApi
3272
+ */
3273
+ let ConfigModule = ConfigModule_1 = class ConfigModule {
3274
+ /**
3275
+ * This promise resolves when "dotenv" completes loading environment variables.
3276
+ * When "ignoreEnvFile" is set to true, then it will resolve immediately after the
3277
+ * "ConfigModule#forRoot" method is called.
3278
+ */
3279
+ static get envVariablesLoaded() {
3280
+ return this._envVariablesLoaded;
3281
+ }
3282
+ /**
3283
+ * Loads environment variables based on the "ignoreEnvFile" flag and "envFilePath" value.
3284
+ * Additionally, registers custom configurations globally.
3285
+ * @param options
3286
+ */
3287
+ static async forRoot(options = {}) {
3288
+ const envFilePaths = Array.isArray(options.envFilePath) ? options.envFilePath : [options.envFilePath || (0, path_1.resolve)(process.cwd(), ".env")];
3289
+ let validatedEnvConfig = void 0;
3290
+ let config = options.ignoreEnvFile ? {} : this.loadEnvFile(envFilePaths, options);
3291
+ if (!options.ignoreEnvVars && options.validatePredefined !== false) config = {
3292
+ ...config,
3293
+ ...process.env
3294
+ };
3295
+ if (options.validate) {
3296
+ const validatedConfig = options.validate(config);
3297
+ validatedEnvConfig = validatedConfig;
3298
+ this.assignVariablesToProcess(validatedConfig);
3299
+ } else if (options.validationSchema) {
3300
+ const validationOptions = this.getSchemaValidationOptions(options);
3301
+ const { error, value: validatedConfig } = options.validationSchema.validate(config, validationOptions);
3302
+ if (error) throw new Error(`Config validation error: ${error.message}`);
3303
+ validatedEnvConfig = validatedConfig;
3304
+ this.assignVariablesToProcess(validatedConfig);
3305
+ } else this.assignVariablesToProcess(config);
3306
+ const isConfigToLoad = options.load && options.load.length;
3307
+ const providers = (await Promise.all(options.load || [])).map((factory) => (0, create_config_factory_util_1.createConfigProvider)(factory)).filter((item) => item);
3308
+ const configProviderTokens = providers.map((item) => item.provide);
3309
+ const configServiceProvider = {
3310
+ provide: config_service_1.ConfigService,
3311
+ useFactory: (configService) => {
3312
+ const untypedConfigService = configService;
3313
+ if (options.cache) untypedConfigService.isCacheEnabled = true;
3314
+ if (options.skipProcessEnv) untypedConfigService.skipProcessEnv = true;
3315
+ configService.setEnvFilePaths(envFilePaths);
3316
+ return configService;
3317
+ },
3318
+ inject: [config_constants_1.CONFIGURATION_SERVICE_TOKEN, ...configProviderTokens]
3319
+ };
3320
+ providers.push(configServiceProvider);
3321
+ if (validatedEnvConfig) {
3322
+ const validatedEnvConfigLoader = {
3323
+ provide: config_constants_1.VALIDATED_ENV_LOADER,
3324
+ useFactory: (host) => {
3325
+ host[config_constants_1.VALIDATED_ENV_PROPNAME] = validatedEnvConfig;
3326
+ },
3327
+ inject: [config_constants_1.CONFIGURATION_TOKEN]
3328
+ };
3329
+ providers.push(validatedEnvConfigLoader);
3330
+ }
3331
+ this.environmentVariablesLoadedSignal();
3332
+ return {
3333
+ module: ConfigModule_1,
3334
+ global: options.isGlobal,
3335
+ providers: isConfigToLoad ? [...providers, {
3336
+ provide: config_constants_1.CONFIGURATION_LOADER,
3337
+ useFactory: (host, ...configurations) => {
3338
+ configurations.forEach((item, index) => this.mergePartial(host, item, providers[index]));
3339
+ },
3340
+ inject: [config_constants_1.CONFIGURATION_TOKEN, ...configProviderTokens]
3341
+ }] : providers,
3342
+ exports: [config_service_1.ConfigService, ...configProviderTokens]
3343
+ };
3344
+ }
3345
+ /**
3346
+ * Registers configuration object (partial registration).
3347
+ * @param config
3348
+ */
3349
+ static forFeature(config) {
3350
+ const configProvider = (0, create_config_factory_util_1.createConfigProvider)(config);
3351
+ const serviceProvider = {
3352
+ provide: config_service_1.ConfigService,
3353
+ useFactory: (configService) => configService,
3354
+ inject: [config_constants_1.CONFIGURATION_SERVICE_TOKEN, configProvider.provide]
3355
+ };
3356
+ return {
3357
+ module: ConfigModule_1,
3358
+ providers: [
3359
+ configProvider,
3360
+ serviceProvider,
3361
+ {
3362
+ provide: config_constants_1.CONFIGURATION_LOADER,
3363
+ useFactory: (host, partialConfig) => {
3364
+ this.mergePartial(host, partialConfig, configProvider);
3365
+ },
3366
+ inject: [config_constants_1.CONFIGURATION_TOKEN, configProvider.provide]
3367
+ }
3368
+ ],
3369
+ exports: [config_service_1.ConfigService, configProvider.provide]
3370
+ };
3371
+ }
3372
+ static loadEnvFile(envFilePaths, options) {
3373
+ let config = {};
3374
+ for (const envFilePath of envFilePaths) if (fs.existsSync(envFilePath)) {
3375
+ config = Object.assign(dotenv.parse(fs.readFileSync(envFilePath)), config);
3376
+ if (options.expandVariables) {
3377
+ const expandOptions = typeof options.expandVariables === "object" ? options.expandVariables : {};
3378
+ config = (0, dotenv_expand_1.expand)({
3379
+ ...expandOptions,
3380
+ parsed: config
3381
+ }).parsed || config;
3382
+ }
3383
+ }
3384
+ return config;
3385
+ }
3386
+ static assignVariablesToProcess(config) {
3387
+ if (!(0, shared_utils_1.isObject)(config)) return;
3388
+ Object.keys(config).filter((key) => !(key in process.env)).forEach((key) => {
3389
+ const value = config[key];
3390
+ if (typeof value === "string") process.env[key] = value;
3391
+ else if (typeof value === "boolean" || typeof value === "number") process.env[key] = `${value}`;
3392
+ });
3393
+ }
3394
+ static mergePartial(host, item, provider) {
3395
+ const factoryRef = provider.useFactory;
3396
+ const token = (0, get_registration_token_util_1.getRegistrationToken)(factoryRef);
3397
+ (0, merge_configs_util_1.mergeConfigObject)(host, item, token);
3398
+ }
3399
+ static getSchemaValidationOptions(options) {
3400
+ if (options.validationOptions) {
3401
+ if (typeof options.validationOptions.allowUnknown === "undefined") options.validationOptions.allowUnknown = true;
3402
+ return options.validationOptions;
3403
+ }
3404
+ return {
3405
+ abortEarly: false,
3406
+ allowUnknown: true
3407
+ };
3408
+ }
3409
+ };
3410
+ exports.ConfigModule = ConfigModule;
3411
+ ConfigModule._envVariablesLoaded = new Promise((resolve) => ConfigModule_1.environmentVariablesLoadedSignal = resolve);
3412
+ exports.ConfigModule = ConfigModule = ConfigModule_1 = __decorate([(0, common_1$1.Module)({
3413
+ imports: [config_host_module_1.ConfigHostModule],
3414
+ providers: [{
3415
+ provide: config_service_1.ConfigService,
3416
+ useExisting: config_constants_1.CONFIGURATION_SERVICE_TOKEN
3417
+ }],
3418
+ exports: [config_host_module_1.ConfigHostModule, config_service_1.ConfigService]
3419
+ })], ConfigModule);
3420
+ }));
3421
+ //#endregion
3422
+ //#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/conditional.module.js
3423
+ var require_conditional_module = /* @__PURE__ */ __commonJSMin(((exports) => {
3424
+ Object.defineProperty(exports, "__esModule", { value: true });
3425
+ exports.ConditionalModule = void 0;
3426
+ const common_1 = require("@nestjs/common");
3427
+ const config_module_1 = require_config_module();
3428
+ /**
3429
+ * Same logic as in `@nestjs/core` package.
3430
+ * @param instance The instance which should get the name from
3431
+ * @returns The name of an instance or `undefined`
3432
+ */
3433
+ const getInstanceName = (instance) => {
3434
+ if (instance?.forwardRef) return instance.forwardRef()?.name;
3435
+ if (instance.module) return instance.module?.name;
3436
+ return instance.name;
3437
+ };
3438
+ exports.ConditionalModule = class ConditionalModule {
3439
+ /**
3440
+ * @publicApi
3441
+ */
3442
+ static async registerWhen(module$1, condition, options) {
3443
+ const { timeout = 5e3, debug = true } = options ?? {};
3444
+ const moduleName = getInstanceName(module$1) || module$1.toString();
3445
+ const timer = setTimeout(() => {
3446
+ throw new Error(`Nest was not able to resolve the config variables within ${timeout} milliseconds. Bause of this, the ConditionalModule was not able to determine if ${moduleName} should be registered or not`);
3447
+ }, timeout);
3448
+ timer.unref();
3449
+ const returnModule = {
3450
+ module: ConditionalModule,
3451
+ imports: [],
3452
+ exports: []
3453
+ };
3454
+ if (typeof condition === "string") {
3455
+ const key = condition;
3456
+ condition = (env) => {
3457
+ return env[key]?.toLowerCase() !== "false";
3458
+ };
3459
+ }
3460
+ await config_module_1.ConfigModule.envVariablesLoaded;
3461
+ clearTimeout(timer);
3462
+ if (condition(process.env)) {
3463
+ returnModule.imports.push(module$1);
3464
+ returnModule.exports.push(module$1);
3465
+ } else if (debug) common_1.Logger.debug(`${condition.toString()} evaluated to false. Skipping the registration of ${moduleName}`, ConditionalModule.name);
3466
+ return returnModule;
3467
+ }
3468
+ };
3469
+ }));
3470
+ //#endregion
3471
+ //#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/types/config-object.type.js
3472
+ var require_config_object_type = /* @__PURE__ */ __commonJSMin(((exports) => {
3473
+ Object.defineProperty(exports, "__esModule", { value: true });
3474
+ }));
3475
+ //#endregion
3476
+ //#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/types/config.type.js
3477
+ var require_config_type = /* @__PURE__ */ __commonJSMin(((exports) => {
3478
+ Object.defineProperty(exports, "__esModule", { value: true });
3479
+ }));
3480
+ //#endregion
3481
+ //#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/types/no-infer.type.js
3482
+ var require_no_infer_type = /* @__PURE__ */ __commonJSMin(((exports) => {
3483
+ Object.defineProperty(exports, "__esModule", { value: true });
3484
+ }));
3485
+ //#endregion
3486
+ //#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/types/path-value.type.js
3487
+ var require_path_value_type = /* @__PURE__ */ __commonJSMin(((exports) => {
3488
+ Object.defineProperty(exports, "__esModule", { value: true });
3489
+ }));
3490
+ //#endregion
3491
+ //#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/types/index.js
3492
+ var require_types = /* @__PURE__ */ __commonJSMin(((exports) => {
3493
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
3494
+ if (k2 === void 0) k2 = k;
3495
+ var desc = Object.getOwnPropertyDescriptor(m, k);
3496
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
3497
+ enumerable: true,
3498
+ get: function() {
3499
+ return m[k];
3500
+ }
3501
+ };
3502
+ Object.defineProperty(o, k2, desc);
3503
+ }) : (function(o, m, k, k2) {
3504
+ if (k2 === void 0) k2 = k;
3505
+ o[k2] = m[k];
3506
+ }));
3507
+ var __exportStar = exports && exports.__exportStar || function(m, exports$4) {
3508
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$4, p)) __createBinding(exports$4, m, p);
3509
+ };
3510
+ Object.defineProperty(exports, "__esModule", { value: true });
3511
+ __exportStar(require_config_object_type(), exports);
3512
+ __exportStar(require_config_type(), exports);
3513
+ __exportStar(require_no_infer_type(), exports);
3514
+ __exportStar(require_path_value_type(), exports);
3515
+ }));
3516
+ //#endregion
3517
+ //#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/utils/register-as.util.js
3518
+ var require_register_as_util = /* @__PURE__ */ __commonJSMin(((exports) => {
3519
+ Object.defineProperty(exports, "__esModule", { value: true });
3520
+ exports.registerAs = registerAs;
3521
+ const __1 = require_dist();
3522
+ const config_constants_1 = require_config_constants();
3523
+ const get_config_token_util_1 = require_get_config_token_util();
3524
+ /**
3525
+ * @publicApi
3526
+ *
3527
+ * Registers the configuration object behind a specified token.
3528
+ */
3529
+ function registerAs(token, configFactory) {
3530
+ const defineProperty = (key, value) => {
3531
+ Object.defineProperty(configFactory, key, {
3532
+ configurable: false,
3533
+ enumerable: false,
3534
+ value,
3535
+ writable: false
3536
+ });
3537
+ };
3538
+ defineProperty(config_constants_1.PARTIAL_CONFIGURATION_KEY, token);
3539
+ defineProperty(config_constants_1.PARTIAL_CONFIGURATION_PROPNAME, (0, get_config_token_util_1.getConfigToken)(token));
3540
+ defineProperty(config_constants_1.AS_PROVIDER_METHOD_KEY, () => ({
3541
+ imports: [__1.ConfigModule.forFeature(configFactory)],
3542
+ useFactory: (config) => config,
3543
+ inject: [(0, get_config_token_util_1.getConfigToken)(token)]
3544
+ }));
3545
+ return configFactory;
3546
+ }
3547
+ }));
3548
+ //#endregion
3549
+ //#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/utils/index.js
3550
+ var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
3551
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
3552
+ if (k2 === void 0) k2 = k;
3553
+ var desc = Object.getOwnPropertyDescriptor(m, k);
3554
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
3555
+ enumerable: true,
3556
+ get: function() {
3557
+ return m[k];
3558
+ }
3559
+ };
3560
+ Object.defineProperty(o, k2, desc);
3561
+ }) : (function(o, m, k, k2) {
3562
+ if (k2 === void 0) k2 = k;
3563
+ o[k2] = m[k];
3564
+ }));
3565
+ var __exportStar = exports && exports.__exportStar || function(m, exports$3) {
3566
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$3, p)) __createBinding(exports$3, m, p);
3567
+ };
3568
+ Object.defineProperty(exports, "__esModule", { value: true });
3569
+ __exportStar(require_register_as_util(), exports);
3570
+ __exportStar(require_get_config_token_util(), exports);
3571
+ }));
3572
+ //#endregion
3573
+ //#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/interfaces/config-change-event.interface.js
3574
+ var require_config_change_event_interface = /* @__PURE__ */ __commonJSMin(((exports) => {
3575
+ Object.defineProperty(exports, "__esModule", { value: true });
3576
+ }));
3577
+ //#endregion
3578
+ //#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/interfaces/config-factory.interface.js
3579
+ var require_config_factory_interface = /* @__PURE__ */ __commonJSMin(((exports) => {
3580
+ Object.defineProperty(exports, "__esModule", { value: true });
3581
+ }));
3582
+ //#endregion
3583
+ //#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/interfaces/config-module-options.interface.js
3584
+ var require_config_module_options_interface = /* @__PURE__ */ __commonJSMin(((exports) => {
3585
+ Object.defineProperty(exports, "__esModule", { value: true });
3586
+ }));
3587
+ //#endregion
3588
+ //#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/interfaces/index.js
3589
+ var require_interfaces = /* @__PURE__ */ __commonJSMin(((exports) => {
3590
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
3591
+ if (k2 === void 0) k2 = k;
3592
+ var desc = Object.getOwnPropertyDescriptor(m, k);
3593
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
3594
+ enumerable: true,
3595
+ get: function() {
3596
+ return m[k];
3597
+ }
3598
+ };
3599
+ Object.defineProperty(o, k2, desc);
3600
+ }) : (function(o, m, k, k2) {
3601
+ if (k2 === void 0) k2 = k;
3602
+ o[k2] = m[k];
3603
+ }));
3604
+ var __exportStar = exports && exports.__exportStar || function(m, exports$2) {
3605
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$2, p)) __createBinding(exports$2, m, p);
3606
+ };
3607
+ Object.defineProperty(exports, "__esModule", { value: true });
3608
+ __exportStar(require_config_change_event_interface(), exports);
3609
+ __exportStar(require_config_factory_interface(), exports);
3610
+ __exportStar(require_config_module_options_interface(), exports);
3611
+ }));
3612
+ //#endregion
3613
+ //#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/index.js
3614
+ var require_dist = /* @__PURE__ */ __commonJSMin(((exports) => {
3615
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
3616
+ if (k2 === void 0) k2 = k;
3617
+ var desc = Object.getOwnPropertyDescriptor(m, k);
3618
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
3619
+ enumerable: true,
3620
+ get: function() {
3621
+ return m[k];
3622
+ }
3623
+ };
3624
+ Object.defineProperty(o, k2, desc);
3625
+ }) : (function(o, m, k, k2) {
3626
+ if (k2 === void 0) k2 = k;
3627
+ o[k2] = m[k];
3628
+ }));
3629
+ var __exportStar = exports && exports.__exportStar || function(m, exports$1) {
3630
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$1, p)) __createBinding(exports$1, m, p);
3631
+ };
3632
+ Object.defineProperty(exports, "__esModule", { value: true });
3633
+ __exportStar(require_conditional_module(), exports);
3634
+ __exportStar(require_config_module(), exports);
3635
+ __exportStar(require_config_service(), exports);
3636
+ __exportStar(require_types(), exports);
3637
+ __exportStar(require_utils(), exports);
3638
+ __exportStar(require_interfaces(), exports);
3639
+ }));
3640
+ //#endregion
3641
+ //#region src/puppeteer/puppeteer.module.ts
3642
+ var import_config = (/* @__PURE__ */ __commonJSMin(((exports) => {
3643
+ function __export(m) {
3644
+ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
3645
+ }
3646
+ exports.__esModule = true;
3647
+ __export(require_dist());
3648
+ })))();
3649
+ var _PuppeteerModule;
3650
+ let PuppeteerModule = _PuppeteerModule = class PuppeteerModule {
3651
+ browserService;
3652
+ pdfParams;
3653
+ constructor(browserService, pdfParams) {
3654
+ this.browserService = browserService;
3655
+ this.pdfParams = pdfParams;
3656
+ }
3657
+ async onModuleInit() {
3658
+ if (!this.pdfParams.executablePath) await this.browserService.install(this.pdfParams.useLockedBrowser ?? false);
3659
+ }
3660
+ static forRoot(pdfParameters) {
3661
+ const providers = [
3662
+ {
3663
+ provide: PDF_PARAMETERS,
3664
+ useValue: pdfParameters
3665
+ },
3666
+ {
3667
+ provide: HANDLEBARS_PARAMETERS,
3668
+ useValue: pdfParameters.hbsOptions ?? {}
3669
+ },
3670
+ _gboutte_nestjs_hbs.HandlebarsService,
3671
+ MjmlService,
3672
+ PugService,
3673
+ EjsService,
3674
+ NunjucksService,
3675
+ EtaService,
3676
+ MustacheService
3677
+ ];
3678
+ return {
3679
+ module: _PuppeteerModule,
3680
+ imports: [import_config.ConfigModule.forRoot()],
3681
+ providers,
3682
+ exports: [
3683
+ PuppeteerService,
3684
+ MjmlService,
3685
+ PugService,
3686
+ EjsService,
3687
+ NunjucksService,
3688
+ EtaService,
3689
+ MustacheService
3690
+ ]
3691
+ };
3692
+ }
3693
+ static forRootAsync(options) {
3694
+ const pdfParamsProvider = {
3695
+ provide: PDF_PARAMETERS,
3696
+ inject: options.inject ?? [],
3697
+ useFactory: async (...args) => options.useFactory(...args)
3698
+ };
3699
+ const hbsParamsProvider = {
3700
+ provide: HANDLEBARS_PARAMETERS,
3701
+ inject: [PDF_PARAMETERS],
3702
+ useFactory: (params) => params.hbsOptions ?? {}
3703
+ };
3704
+ return {
3705
+ module: _PuppeteerModule,
3706
+ imports: [...options.imports ?? [], import_config.ConfigModule.forRoot()],
3707
+ providers: [
3708
+ pdfParamsProvider,
3709
+ hbsParamsProvider,
3710
+ PuppeteerService,
3711
+ BrowserService,
3712
+ _gboutte_nestjs_hbs.HandlebarsService,
3713
+ MjmlService,
3714
+ PugService,
3715
+ EjsService,
3716
+ NunjucksService,
3717
+ EtaService,
3718
+ MustacheService
3719
+ ],
3720
+ exports: [
3721
+ PuppeteerService,
3722
+ MjmlService,
3723
+ PugService,
3724
+ EjsService,
3725
+ NunjucksService,
3726
+ EtaService,
3727
+ MustacheService
3728
+ ]
3729
+ };
3730
+ }
3731
+ };
3732
+ PuppeteerModule = _PuppeteerModule = __decorate([
3733
+ (0, _nestjs_common.Module)({
3734
+ providers: [
3735
+ PuppeteerService,
3736
+ BrowserService,
3737
+ MjmlService,
3738
+ PugService,
3739
+ EjsService,
3740
+ NunjucksService,
3741
+ EtaService,
3742
+ MustacheService
3743
+ ],
3744
+ exports: [
3745
+ PuppeteerService,
3746
+ MjmlService,
3747
+ PugService,
3748
+ EjsService,
3749
+ NunjucksService,
3750
+ EtaService,
3751
+ MustacheService
3752
+ ]
3753
+ }),
3754
+ __decorateParam(1, (0, _nestjs_common.Inject)(PDF_PARAMETERS)),
3755
+ __decorateMetadata("design:paramtypes", [typeof BrowserService === "undefined" ? Object : BrowserService, Object])
3756
+ ], PuppeteerModule);
3757
+ //#endregion
3758
+ //#region src/nestjs-pdf.module.ts
3759
+ var _NestjsPdfModule;
3760
+ let NestjsPdfModule = _NestjsPdfModule = class NestjsPdfModule {
3761
+ static forRoot(options) {
3762
+ return {
3763
+ module: _NestjsPdfModule,
3764
+ imports: [PuppeteerModule.forRoot(options)],
3765
+ providers: [NestjsPdfService],
3766
+ exports: [NestjsPdfService]
3767
+ };
3768
+ }
3769
+ static forRootAsync(options) {
3770
+ return {
3771
+ module: _NestjsPdfModule,
3772
+ imports: [PuppeteerModule.forRootAsync(options)],
3773
+ providers: [NestjsPdfService],
3774
+ exports: [NestjsPdfService]
3775
+ };
3776
+ }
3777
+ };
3778
+ NestjsPdfModule = _NestjsPdfModule = __decorate([(0, _nestjs_common.Module)({})], NestjsPdfModule);
3779
+ //#endregion
3780
+ Object.defineProperty(exports, "EjsService", {
3781
+ enumerable: true,
3782
+ get: function() {
3783
+ return EjsService;
3784
+ }
3785
+ });
3786
+ Object.defineProperty(exports, "EtaService", {
3787
+ enumerable: true,
3788
+ get: function() {
3789
+ return EtaService;
3790
+ }
3791
+ });
3792
+ Object.defineProperty(exports, "MjmlService", {
3793
+ enumerable: true,
3794
+ get: function() {
3795
+ return MjmlService;
3796
+ }
3797
+ });
3798
+ Object.defineProperty(exports, "MustacheService", {
3799
+ enumerable: true,
3800
+ get: function() {
3801
+ return MustacheService;
3802
+ }
3803
+ });
3804
+ Object.defineProperty(exports, "NestjsPdfModule", {
3805
+ enumerable: true,
3806
+ get: function() {
3807
+ return NestjsPdfModule;
3808
+ }
3809
+ });
3810
+ Object.defineProperty(exports, "NestjsPdfService", {
3811
+ enumerable: true,
3812
+ get: function() {
3813
+ return NestjsPdfService;
3814
+ }
3815
+ });
3816
+ Object.defineProperty(exports, "NunjucksService", {
3817
+ enumerable: true,
3818
+ get: function() {
3819
+ return NunjucksService;
3820
+ }
3821
+ });
3822
+ Object.defineProperty(exports, "PugService", {
3823
+ enumerable: true,
3824
+ get: function() {
3825
+ return PugService;
3826
+ }
3827
+ });
3828
+ Object.defineProperty(exports, "PuppeteerModule", {
3829
+ enumerable: true,
3830
+ get: function() {
3831
+ return PuppeteerModule;
3832
+ }
3833
+ });
3834
+ Object.defineProperty(exports, "PuppeteerService", {
3835
+ enumerable: true,
3836
+ get: function() {
3837
+ return PuppeteerService;
3838
+ }
3839
+ });
3840
+ exports.getRelativePathToValue = getRelativePathToValue;