voxflow 1.8.2 → 1.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,750 @@
1
+ "use strict";
2
+ exports.id = 609;
3
+ exports.ids = [609];
4
+ exports.modules = {
5
+
6
+ /***/ 5609:
7
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
8
+
9
+ // ESM COMPAT FLAG
10
+ __webpack_require__.r(__webpack_exports__);
11
+
12
+ // EXPORTS
13
+ __webpack_require__.d(__webpack_exports__, {
14
+ apps: () => (/* binding */ apps),
15
+ "default": () => (/* binding */ node_modules_open),
16
+ openApp: () => (/* binding */ openApp)
17
+ });
18
+
19
+ // EXTERNAL MODULE: external "node:process"
20
+ var external_node_process_ = __webpack_require__(1708);
21
+ // EXTERNAL MODULE: external "node:buffer"
22
+ var external_node_buffer_ = __webpack_require__(4573);
23
+ // EXTERNAL MODULE: external "node:path"
24
+ var external_node_path_ = __webpack_require__(6760);
25
+ // EXTERNAL MODULE: external "node:url"
26
+ var external_node_url_ = __webpack_require__(755);
27
+ // EXTERNAL MODULE: external "node:util"
28
+ var external_node_util_ = __webpack_require__(7975);
29
+ // EXTERNAL MODULE: external "node:child_process"
30
+ var external_node_child_process_ = __webpack_require__(1421);
31
+ // EXTERNAL MODULE: external "node:fs/promises"
32
+ var promises_ = __webpack_require__(1455);
33
+ // EXTERNAL MODULE: external "node:os"
34
+ var external_node_os_ = __webpack_require__(8161);
35
+ // EXTERNAL MODULE: external "node:fs"
36
+ var external_node_fs_ = __webpack_require__(3024);
37
+ ;// CONCATENATED MODULE: ../node_modules/is-docker/index.js
38
+
39
+
40
+ let isDockerCached;
41
+
42
+ function hasDockerEnv() {
43
+ try {
44
+ external_node_fs_.statSync('/.dockerenv');
45
+ return true;
46
+ } catch {
47
+ return false;
48
+ }
49
+ }
50
+
51
+ function hasDockerCGroup() {
52
+ try {
53
+ return external_node_fs_.readFileSync('/proc/self/cgroup', 'utf8').includes('docker');
54
+ } catch {
55
+ return false;
56
+ }
57
+ }
58
+
59
+ function isDocker() {
60
+ // TODO: Use `??=` when targeting Node.js 16.
61
+ if (isDockerCached === undefined) {
62
+ isDockerCached = hasDockerEnv() || hasDockerCGroup();
63
+ }
64
+
65
+ return isDockerCached;
66
+ }
67
+
68
+ ;// CONCATENATED MODULE: ../node_modules/is-inside-container/index.js
69
+
70
+
71
+
72
+ let cachedResult;
73
+
74
+ // Podman detection
75
+ const hasContainerEnv = () => {
76
+ try {
77
+ external_node_fs_.statSync('/run/.containerenv');
78
+ return true;
79
+ } catch {
80
+ return false;
81
+ }
82
+ };
83
+
84
+ function isInsideContainer() {
85
+ // TODO: Use `??=` when targeting Node.js 16.
86
+ if (cachedResult === undefined) {
87
+ cachedResult = hasContainerEnv() || isDocker();
88
+ }
89
+
90
+ return cachedResult;
91
+ }
92
+
93
+ ;// CONCATENATED MODULE: ../node_modules/is-wsl/index.js
94
+
95
+
96
+
97
+
98
+
99
+ const isWsl = () => {
100
+ if (external_node_process_.platform !== 'linux') {
101
+ return false;
102
+ }
103
+
104
+ if (external_node_os_.release().toLowerCase().includes('microsoft')) {
105
+ if (isInsideContainer()) {
106
+ return false;
107
+ }
108
+
109
+ return true;
110
+ }
111
+
112
+ try {
113
+ if (external_node_fs_.readFileSync('/proc/version', 'utf8').toLowerCase().includes('microsoft')) {
114
+ return !isInsideContainer();
115
+ }
116
+ } catch {}
117
+
118
+ // Fallback for custom kernels: check WSL-specific paths.
119
+ if (
120
+ external_node_fs_.existsSync('/proc/sys/fs/binfmt_misc/WSLInterop')
121
+ || external_node_fs_.existsSync('/run/WSL')
122
+ ) {
123
+ return !isInsideContainer();
124
+ }
125
+
126
+ return false;
127
+ };
128
+
129
+ /* harmony default export */ const is_wsl = (external_node_process_.env.__IS_WSL_TEST__ ? isWsl : isWsl());
130
+
131
+ ;// CONCATENATED MODULE: ../node_modules/wsl-utils/index.js
132
+
133
+
134
+
135
+
136
+ const wslDrivesMountPoint = (() => {
137
+ // Default value for "root" param
138
+ // according to https://docs.microsoft.com/en-us/windows/wsl/wsl-config
139
+ const defaultMountPoint = '/mnt/';
140
+
141
+ let mountPoint;
142
+
143
+ return async function () {
144
+ if (mountPoint) {
145
+ // Return memoized mount point value
146
+ return mountPoint;
147
+ }
148
+
149
+ const configFilePath = '/etc/wsl.conf';
150
+
151
+ let isConfigFileExists = false;
152
+ try {
153
+ await promises_.access(configFilePath, promises_.constants.F_OK);
154
+ isConfigFileExists = true;
155
+ } catch {}
156
+
157
+ if (!isConfigFileExists) {
158
+ return defaultMountPoint;
159
+ }
160
+
161
+ const configContent = await promises_.readFile(configFilePath, {encoding: 'utf8'});
162
+ const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
163
+
164
+ if (!configMountPoint) {
165
+ return defaultMountPoint;
166
+ }
167
+
168
+ mountPoint = configMountPoint.groups.mountPoint.trim();
169
+ mountPoint = mountPoint.endsWith('/') ? mountPoint : `${mountPoint}/`;
170
+
171
+ return mountPoint;
172
+ };
173
+ })();
174
+
175
+ const powerShellPathFromWsl = async () => {
176
+ const mountPoint = await wslDrivesMountPoint();
177
+ return `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
178
+ };
179
+
180
+ const powerShellPath = async () => {
181
+ if (is_wsl) {
182
+ return powerShellPathFromWsl();
183
+ }
184
+
185
+ return `${external_node_process_.env.SYSTEMROOT || external_node_process_.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
186
+ };
187
+
188
+
189
+
190
+ ;// CONCATENATED MODULE: ../node_modules/define-lazy-prop/index.js
191
+ function defineLazyProperty(object, propertyName, valueGetter) {
192
+ const define = value => Object.defineProperty(object, propertyName, {value, enumerable: true, writable: true});
193
+
194
+ Object.defineProperty(object, propertyName, {
195
+ configurable: true,
196
+ enumerable: true,
197
+ get() {
198
+ const result = valueGetter();
199
+ define(result);
200
+ return result;
201
+ },
202
+ set(value) {
203
+ define(value);
204
+ }
205
+ });
206
+
207
+ return object;
208
+ }
209
+
210
+ ;// CONCATENATED MODULE: ../node_modules/default-browser-id/index.js
211
+
212
+
213
+
214
+
215
+ const execFileAsync = (0,external_node_util_.promisify)(external_node_child_process_.execFile);
216
+
217
+ async function defaultBrowserId() {
218
+ if (external_node_process_.platform !== 'darwin') {
219
+ throw new Error('macOS only');
220
+ }
221
+
222
+ const {stdout} = await execFileAsync('defaults', ['read', 'com.apple.LaunchServices/com.apple.launchservices.secure', 'LSHandlers']);
223
+
224
+ // `(?!-)` is to prevent matching `LSHandlerRoleAll = "-";`.
225
+ const match = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout);
226
+
227
+ const browserId = match?.groups.id ?? 'com.apple.Safari';
228
+
229
+ // Correct the case for Safari's bundle identifier
230
+ if (browserId === 'com.apple.safari') {
231
+ return 'com.apple.Safari';
232
+ }
233
+
234
+ return browserId;
235
+ }
236
+
237
+ ;// CONCATENATED MODULE: ../node_modules/run-applescript/index.js
238
+
239
+
240
+
241
+
242
+ const run_applescript_execFileAsync = (0,external_node_util_.promisify)(external_node_child_process_.execFile);
243
+
244
+ async function runAppleScript(script, {humanReadableOutput = true, signal} = {}) {
245
+ if (external_node_process_.platform !== 'darwin') {
246
+ throw new Error('macOS only');
247
+ }
248
+
249
+ const outputArguments = humanReadableOutput ? [] : ['-ss'];
250
+
251
+ const execOptions = {};
252
+ if (signal) {
253
+ execOptions.signal = signal;
254
+ }
255
+
256
+ const {stdout} = await run_applescript_execFileAsync('osascript', ['-e', script, outputArguments], execOptions);
257
+ return stdout.trim();
258
+ }
259
+
260
+ function runAppleScriptSync(script, {humanReadableOutput = true} = {}) {
261
+ if (process.platform !== 'darwin') {
262
+ throw new Error('macOS only');
263
+ }
264
+
265
+ const outputArguments = humanReadableOutput ? [] : ['-ss'];
266
+
267
+ const stdout = execFileSync('osascript', ['-e', script, ...outputArguments], {
268
+ encoding: 'utf8',
269
+ stdio: ['ignore', 'pipe', 'ignore'],
270
+ timeout: 500,
271
+ });
272
+
273
+ return stdout.trim();
274
+ }
275
+
276
+ ;// CONCATENATED MODULE: ../node_modules/bundle-name/index.js
277
+
278
+
279
+ async function bundleName(bundleId) {
280
+ return runAppleScript(`tell application "Finder" to set app_path to application file id "${bundleId}" as string\ntell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
281
+ }
282
+
283
+ ;// CONCATENATED MODULE: ../node_modules/default-browser/windows.js
284
+
285
+
286
+
287
+ const windows_execFileAsync = (0,external_node_util_.promisify)(external_node_child_process_.execFile);
288
+
289
+ // TODO: Fix the casing of bundle identifiers in the next major version.
290
+
291
+ // Windows doesn't have browser IDs in the same way macOS/Linux does so we give fake
292
+ // ones that look real and match the macOS/Linux versions for cross-platform apps.
293
+ const windowsBrowserProgIds = {
294
+ MSEdgeHTM: {name: 'Edge', id: 'com.microsoft.edge'}, // The missing `L` is correct.
295
+ MSEdgeBHTML: {name: 'Edge Beta', id: 'com.microsoft.edge.beta'},
296
+ MSEdgeDHTML: {name: 'Edge Dev', id: 'com.microsoft.edge.dev'},
297
+ AppXq0fevzme2pys62n3e0fbqa7peapykr8v: {name: 'Edge', id: 'com.microsoft.edge.old'},
298
+ ChromeHTML: {name: 'Chrome', id: 'com.google.chrome'},
299
+ ChromeBHTML: {name: 'Chrome Beta', id: 'com.google.chrome.beta'},
300
+ ChromeDHTML: {name: 'Chrome Dev', id: 'com.google.chrome.dev'},
301
+ ChromiumHTM: {name: 'Chromium', id: 'org.chromium.Chromium'},
302
+ BraveHTML: {name: 'Brave', id: 'com.brave.Browser'},
303
+ BraveBHTML: {name: 'Brave Beta', id: 'com.brave.Browser.beta'},
304
+ BraveDHTML: {name: 'Brave Dev', id: 'com.brave.Browser.dev'},
305
+ BraveSSHTM: {name: 'Brave Nightly', id: 'com.brave.Browser.nightly'},
306
+ FirefoxURL: {name: 'Firefox', id: 'org.mozilla.firefox'},
307
+ OperaStable: {name: 'Opera', id: 'com.operasoftware.Opera'},
308
+ VivaldiHTM: {name: 'Vivaldi', id: 'com.vivaldi.Vivaldi'},
309
+ 'IE.HTTP': {name: 'Internet Explorer', id: 'com.microsoft.ie'},
310
+ };
311
+
312
+ const _windowsBrowserProgIdMap = new Map(Object.entries(windowsBrowserProgIds));
313
+
314
+ class UnknownBrowserError extends Error {}
315
+
316
+ async function defaultBrowser(_execFileAsync = windows_execFileAsync) {
317
+ const {stdout} = await _execFileAsync('reg', [
318
+ 'QUERY',
319
+ ' HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice',
320
+ '/v',
321
+ 'ProgId',
322
+ ]);
323
+
324
+ const match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout);
325
+ if (!match) {
326
+ throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout)}`);
327
+ }
328
+
329
+ const {id} = match.groups;
330
+
331
+ // Windows can append a hash suffix to ProgIds using a dot or hyphen
332
+ // (e.g., `ChromeHTML.ABC123`, `FirefoxURL-6F193CCC56814779`).
333
+ // Try exact match first, then try without the suffix.
334
+ const dotIndex = id.lastIndexOf('.');
335
+ const hyphenIndex = id.lastIndexOf('-');
336
+ const baseIdByDot = dotIndex === -1 ? undefined : id.slice(0, dotIndex);
337
+ const baseIdByHyphen = hyphenIndex === -1 ? undefined : id.slice(0, hyphenIndex);
338
+
339
+ return windowsBrowserProgIds[id] ?? windowsBrowserProgIds[baseIdByDot] ?? windowsBrowserProgIds[baseIdByHyphen] ?? {name: id, id};
340
+ }
341
+
342
+ ;// CONCATENATED MODULE: ../node_modules/default-browser/index.js
343
+
344
+
345
+
346
+
347
+
348
+
349
+
350
+
351
+
352
+ const default_browser_execFileAsync = (0,external_node_util_.promisify)(external_node_child_process_.execFile);
353
+
354
+ // Inlined: https://github.com/sindresorhus/titleize/blob/main/index.js
355
+ const titleize = string => string.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, x => x.toUpperCase());
356
+
357
+ async function default_browser_defaultBrowser() {
358
+ if (external_node_process_.platform === 'darwin') {
359
+ const id = await defaultBrowserId();
360
+ const name = await bundleName(id);
361
+ return {name, id};
362
+ }
363
+
364
+ if (external_node_process_.platform === 'linux') {
365
+ const {stdout} = await default_browser_execFileAsync('xdg-mime', ['query', 'default', 'x-scheme-handler/http']);
366
+ const id = stdout.trim();
367
+ const name = titleize(id.replace(/.desktop$/, '').replace('-', ' '));
368
+ return {name, id};
369
+ }
370
+
371
+ if (external_node_process_.platform === 'win32') {
372
+ return defaultBrowser();
373
+ }
374
+
375
+ throw new Error('Only macOS, Linux, and Windows are supported');
376
+ }
377
+
378
+ ;// CONCATENATED MODULE: ../node_modules/open/index.js
379
+
380
+
381
+
382
+
383
+
384
+
385
+
386
+
387
+
388
+
389
+
390
+
391
+ const execFile = (0,external_node_util_.promisify)(external_node_child_process_.execFile);
392
+
393
+ // Path to included `xdg-open`.
394
+ const open_dirname = external_node_path_.dirname((0,external_node_url_.fileURLToPath)(require("url").pathToFileURL(__filename).href));
395
+ const localXdgOpenPath = external_node_path_.join(open_dirname, 'xdg-open');
396
+
397
+ const {platform, arch} = external_node_process_;
398
+
399
+ /**
400
+ Get the default browser name in Windows from WSL.
401
+
402
+ @returns {Promise<string>} Browser name.
403
+ */
404
+ async function getWindowsDefaultBrowserFromWsl() {
405
+ const powershellPath = await powerShellPath();
406
+ const rawCommand = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`;
407
+ const encodedCommand = external_node_buffer_.Buffer.from(rawCommand, 'utf16le').toString('base64');
408
+
409
+ const {stdout} = await execFile(
410
+ powershellPath,
411
+ [
412
+ '-NoProfile',
413
+ '-NonInteractive',
414
+ '-ExecutionPolicy',
415
+ 'Bypass',
416
+ '-EncodedCommand',
417
+ encodedCommand,
418
+ ],
419
+ {encoding: 'utf8'},
420
+ );
421
+
422
+ const progId = stdout.trim();
423
+
424
+ // Map ProgId to browser IDs
425
+ const browserMap = {
426
+ ChromeHTML: 'com.google.chrome',
427
+ BraveHTML: 'com.brave.Browser',
428
+ MSEdgeHTM: 'com.microsoft.edge',
429
+ FirefoxURL: 'org.mozilla.firefox',
430
+ };
431
+
432
+ return browserMap[progId] ? {id: browserMap[progId]} : {};
433
+ }
434
+
435
+ const pTryEach = async (array, mapper) => {
436
+ let latestError;
437
+
438
+ for (const item of array) {
439
+ try {
440
+ return await mapper(item); // eslint-disable-line no-await-in-loop
441
+ } catch (error) {
442
+ latestError = error;
443
+ }
444
+ }
445
+
446
+ throw latestError;
447
+ };
448
+
449
+ // eslint-disable-next-line complexity
450
+ const baseOpen = async options => {
451
+ options = {
452
+ wait: false,
453
+ background: false,
454
+ newInstance: false,
455
+ allowNonzeroExitCode: false,
456
+ ...options,
457
+ };
458
+
459
+ if (Array.isArray(options.app)) {
460
+ return pTryEach(options.app, singleApp => baseOpen({
461
+ ...options,
462
+ app: singleApp,
463
+ }));
464
+ }
465
+
466
+ let {name: app, arguments: appArguments = []} = options.app ?? {};
467
+ appArguments = [...appArguments];
468
+
469
+ if (Array.isArray(app)) {
470
+ return pTryEach(app, appName => baseOpen({
471
+ ...options,
472
+ app: {
473
+ name: appName,
474
+ arguments: appArguments,
475
+ },
476
+ }));
477
+ }
478
+
479
+ if (app === 'browser' || app === 'browserPrivate') {
480
+ // IDs from default-browser for macOS and windows are the same
481
+ const ids = {
482
+ 'com.google.chrome': 'chrome',
483
+ 'google-chrome.desktop': 'chrome',
484
+ 'com.brave.Browser': 'brave',
485
+ 'org.mozilla.firefox': 'firefox',
486
+ 'firefox.desktop': 'firefox',
487
+ 'com.microsoft.msedge': 'edge',
488
+ 'com.microsoft.edge': 'edge',
489
+ 'com.microsoft.edgemac': 'edge',
490
+ 'microsoft-edge.desktop': 'edge',
491
+ };
492
+
493
+ // Incognito flags for each browser in `apps`.
494
+ const flags = {
495
+ chrome: '--incognito',
496
+ brave: '--incognito',
497
+ firefox: '--private-window',
498
+ edge: '--inPrivate',
499
+ };
500
+
501
+ const browser = is_wsl ? await getWindowsDefaultBrowserFromWsl() : await default_browser_defaultBrowser();
502
+ if (browser.id in ids) {
503
+ const browserName = ids[browser.id];
504
+
505
+ if (app === 'browserPrivate') {
506
+ appArguments.push(flags[browserName]);
507
+ }
508
+
509
+ return baseOpen({
510
+ ...options,
511
+ app: {
512
+ name: apps[browserName],
513
+ arguments: appArguments,
514
+ },
515
+ });
516
+ }
517
+
518
+ throw new Error(`${browser.name} is not supported as a default browser`);
519
+ }
520
+
521
+ let command;
522
+ const cliArguments = [];
523
+ const childProcessOptions = {};
524
+
525
+ if (platform === 'darwin') {
526
+ command = 'open';
527
+
528
+ if (options.wait) {
529
+ cliArguments.push('--wait-apps');
530
+ }
531
+
532
+ if (options.background) {
533
+ cliArguments.push('--background');
534
+ }
535
+
536
+ if (options.newInstance) {
537
+ cliArguments.push('--new');
538
+ }
539
+
540
+ if (app) {
541
+ cliArguments.push('-a', app);
542
+ }
543
+ } else if (platform === 'win32' || (is_wsl && !isInsideContainer() && !app)) {
544
+ command = await powerShellPath();
545
+
546
+ cliArguments.push(
547
+ '-NoProfile',
548
+ '-NonInteractive',
549
+ '-ExecutionPolicy',
550
+ 'Bypass',
551
+ '-EncodedCommand',
552
+ );
553
+
554
+ if (!is_wsl) {
555
+ childProcessOptions.windowsVerbatimArguments = true;
556
+ }
557
+
558
+ const encodedArguments = ['Start'];
559
+
560
+ if (options.wait) {
561
+ encodedArguments.push('-Wait');
562
+ }
563
+
564
+ if (app) {
565
+ // Double quote with double quotes to ensure the inner quotes are passed through.
566
+ // Inner quotes are delimited for PowerShell interpretation with backticks.
567
+ encodedArguments.push(`"\`"${app}\`""`);
568
+ if (options.target) {
569
+ appArguments.push(options.target);
570
+ }
571
+ } else if (options.target) {
572
+ encodedArguments.push(`"${options.target}"`);
573
+ }
574
+
575
+ if (appArguments.length > 0) {
576
+ appArguments = appArguments.map(argument => `"\`"${argument}\`""`);
577
+ encodedArguments.push('-ArgumentList', appArguments.join(','));
578
+ }
579
+
580
+ // Using Base64-encoded command, accepted by PowerShell, to allow special characters.
581
+ options.target = external_node_buffer_.Buffer.from(encodedArguments.join(' '), 'utf16le').toString('base64');
582
+ } else {
583
+ if (app) {
584
+ command = app;
585
+ } else {
586
+ // When bundled by Webpack, there's no actual package file path and no local `xdg-open`.
587
+ const isBundled = !open_dirname || open_dirname === '/';
588
+
589
+ // Check if local `xdg-open` exists and is executable.
590
+ let exeLocalXdgOpen = false;
591
+ try {
592
+ await promises_.access(localXdgOpenPath, promises_.constants.X_OK);
593
+ exeLocalXdgOpen = true;
594
+ } catch {}
595
+
596
+ const useSystemXdgOpen = external_node_process_.versions.electron
597
+ ?? (platform === 'android' || isBundled || !exeLocalXdgOpen);
598
+ command = useSystemXdgOpen ? 'xdg-open' : localXdgOpenPath;
599
+ }
600
+
601
+ if (appArguments.length > 0) {
602
+ cliArguments.push(...appArguments);
603
+ }
604
+
605
+ if (!options.wait) {
606
+ // `xdg-open` will block the process unless stdio is ignored
607
+ // and it's detached from the parent even if it's unref'd.
608
+ childProcessOptions.stdio = 'ignore';
609
+ childProcessOptions.detached = true;
610
+ }
611
+ }
612
+
613
+ if (platform === 'darwin' && appArguments.length > 0) {
614
+ cliArguments.push('--args', ...appArguments);
615
+ }
616
+
617
+ // This has to come after `--args`.
618
+ if (options.target) {
619
+ cliArguments.push(options.target);
620
+ }
621
+
622
+ const subprocess = external_node_child_process_.spawn(command, cliArguments, childProcessOptions);
623
+
624
+ if (options.wait) {
625
+ return new Promise((resolve, reject) => {
626
+ subprocess.once('error', reject);
627
+
628
+ subprocess.once('close', exitCode => {
629
+ if (!options.allowNonzeroExitCode && exitCode > 0) {
630
+ reject(new Error(`Exited with code ${exitCode}`));
631
+ return;
632
+ }
633
+
634
+ resolve(subprocess);
635
+ });
636
+ });
637
+ }
638
+
639
+ subprocess.unref();
640
+
641
+ return subprocess;
642
+ };
643
+
644
+ const open_open = (target, options) => {
645
+ if (typeof target !== 'string') {
646
+ throw new TypeError('Expected a `target`');
647
+ }
648
+
649
+ return baseOpen({
650
+ ...options,
651
+ target,
652
+ });
653
+ };
654
+
655
+ const openApp = (name, options) => {
656
+ if (typeof name !== 'string' && !Array.isArray(name)) {
657
+ throw new TypeError('Expected a valid `name`');
658
+ }
659
+
660
+ const {arguments: appArguments = []} = options ?? {};
661
+ if (appArguments !== undefined && appArguments !== null && !Array.isArray(appArguments)) {
662
+ throw new TypeError('Expected `appArguments` as Array type');
663
+ }
664
+
665
+ return baseOpen({
666
+ ...options,
667
+ app: {
668
+ name,
669
+ arguments: appArguments,
670
+ },
671
+ });
672
+ };
673
+
674
+ function detectArchBinary(binary) {
675
+ if (typeof binary === 'string' || Array.isArray(binary)) {
676
+ return binary;
677
+ }
678
+
679
+ const {[arch]: archBinary} = binary;
680
+
681
+ if (!archBinary) {
682
+ throw new Error(`${arch} is not supported`);
683
+ }
684
+
685
+ return archBinary;
686
+ }
687
+
688
+ function detectPlatformBinary({[platform]: platformBinary}, {wsl}) {
689
+ if (wsl && is_wsl) {
690
+ return detectArchBinary(wsl);
691
+ }
692
+
693
+ if (!platformBinary) {
694
+ throw new Error(`${platform} is not supported`);
695
+ }
696
+
697
+ return detectArchBinary(platformBinary);
698
+ }
699
+
700
+ const apps = {};
701
+
702
+ defineLazyProperty(apps, 'chrome', () => detectPlatformBinary({
703
+ darwin: 'google chrome',
704
+ win32: 'chrome',
705
+ linux: ['google-chrome', 'google-chrome-stable', 'chromium'],
706
+ }, {
707
+ wsl: {
708
+ ia32: '/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe',
709
+ x64: ['/mnt/c/Program Files/Google/Chrome/Application/chrome.exe', '/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe'],
710
+ },
711
+ }));
712
+
713
+ defineLazyProperty(apps, 'brave', () => detectPlatformBinary({
714
+ darwin: 'brave browser',
715
+ win32: 'brave',
716
+ linux: ['brave-browser', 'brave'],
717
+ }, {
718
+ wsl: {
719
+ ia32: '/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe',
720
+ x64: ['/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe', '/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe'],
721
+ },
722
+ }));
723
+
724
+ defineLazyProperty(apps, 'firefox', () => detectPlatformBinary({
725
+ darwin: 'firefox',
726
+ win32: String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,
727
+ linux: 'firefox',
728
+ }, {
729
+ wsl: '/mnt/c/Program Files/Mozilla Firefox/firefox.exe',
730
+ }));
731
+
732
+ defineLazyProperty(apps, 'edge', () => detectPlatformBinary({
733
+ darwin: 'microsoft edge',
734
+ win32: 'msedge',
735
+ linux: ['microsoft-edge', 'microsoft-edge-dev'],
736
+ }, {
737
+ wsl: '/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe',
738
+ }));
739
+
740
+ defineLazyProperty(apps, 'browser', () => 'browser');
741
+
742
+ defineLazyProperty(apps, 'browserPrivate', () => 'browserPrivate');
743
+
744
+ /* harmony default export */ const node_modules_open = (open_open);
745
+
746
+
747
+ /***/ })
748
+
749
+ };
750
+ ;