forge-terminal 0.5.2 → 0.5.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.
Files changed (66) hide show
  1. package/README.md +7 -5
  2. package/dist/chunks/{about-credits-VZQJAWG3.js → about-credits-WSRAKKZF.js} +1 -1
  3. package/dist/chunks/{args-FZXEZBPA.js → args-6CKJ6KH6.js} +1 -1
  4. package/dist/chunks/{boot-NYKO3NLR.js → boot-HOUBXHJL.js} +1 -1
  5. package/dist/chunks/{chunk-63ZZRDSV.js → chunk-3FLV43Q2.js} +1 -1
  6. package/dist/chunks/chunk-6RMRWBMB.js +3 -0
  7. package/dist/chunks/{chunk-LA5JVBFP.js → chunk-7UMELAOL.js} +1 -1
  8. package/dist/chunks/{chunk-DYIATUFE.js → chunk-7WZYTDFI.js} +1 -1
  9. package/dist/chunks/{chunk-GRWOJKQB.js → chunk-BB43QVW4.js} +1 -1
  10. package/dist/chunks/{chunk-GT6U6HV3.js → chunk-CWQCFW5J.js} +1 -1
  11. package/dist/chunks/{chunk-K6ERQTUQ.js → chunk-IE6NFN3N.js} +1 -1
  12. package/dist/chunks/chunk-J7GGNBDR.js +3 -0
  13. package/dist/chunks/chunk-KOHJP7T4.js +82 -0
  14. package/dist/chunks/{chunk-IED6VBE6.js → chunk-KS4ZE3X2.js} +1 -1
  15. package/dist/chunks/{chunk-XUKYIVJC.js → chunk-KSWBIKCI.js} +1 -1
  16. package/dist/chunks/{chunk-CW2Y2KDQ.js → chunk-LJXEQGKU.js} +1 -1
  17. package/dist/chunks/{chunk-2AFHW44W.js → chunk-LSVZEQVK.js} +2 -2
  18. package/dist/chunks/{chunk-RK3WGALB.js → chunk-MBZRADAZ.js} +1 -1
  19. package/dist/chunks/{chunk-JGJU3AW5.js → chunk-NS5CJZ4B.js} +1 -1
  20. package/dist/chunks/{chunk-R24JCIZ5.js → chunk-PLBLOIQI.js} +1 -1
  21. package/dist/chunks/{chunk-KMLT45OJ.js → chunk-QPYAKAHI.js} +2 -2
  22. package/dist/chunks/{chunk-W2QJA73Q.js → chunk-RW4TOC5E.js} +1 -1
  23. package/dist/chunks/{chunk-ITW5FG4K.js → chunk-SBQWOZTA.js} +1 -1
  24. package/dist/chunks/{chunk-J2UQI544.js → chunk-SNXX5TVZ.js} +2 -2
  25. package/dist/chunks/chunk-TFOEI5VF.js +3 -0
  26. package/dist/chunks/{chunk-IVBSXPNS.js → chunk-VNZ3D7VG.js} +1 -1
  27. package/dist/chunks/{chunk-XPATZLEH.js → chunk-WE5MOCUL.js} +1 -1
  28. package/dist/chunks/chunk-YO2DKGGU.js +3 -0
  29. package/dist/chunks/{chunk-ZFLFBNIK.js → chunk-YURNOHEF.js} +1 -1
  30. package/dist/chunks/chunk-ZX5FDZZW.js +55 -0
  31. package/dist/chunks/clip-command-S4JYPD6N.js +3 -0
  32. package/dist/chunks/{colour-LMZO2EE6.js → colour-PXJ2VKHU.js} +1 -1
  33. package/dist/chunks/command-BKAPI4A5.js +3 -0
  34. package/dist/chunks/{entry-TV4FJQDR.js → entry-RDY5AQA5.js} +2 -2
  35. package/dist/chunks/execute-7NVA5QSU.js +3 -0
  36. package/dist/chunks/{extensions-4UJRQ32J.js → extensions-VHU2V3B6.js} +1 -1
  37. package/dist/chunks/{extensions-command-VROVGVD4.js → extensions-command-VT5CGCL5.js} +1 -1
  38. package/dist/chunks/{ffmpeg-OIVMTPY7.js → ffmpeg-N4SJFTIP.js} +1 -1
  39. package/dist/chunks/{image-J5WDYORX.js → image-YMCS4PTS.js} +1 -1
  40. package/dist/chunks/{install-5XLVERRR.js → install-LDERVCWM.js} +1 -1
  41. package/dist/chunks/launch-UEEW4R7F.js +17 -0
  42. package/dist/chunks/{manager-T3WDLUKR.js → manager-QOSWVNWL.js} +1 -1
  43. package/dist/chunks/{needed-YU5BPYD6.js → needed-P2KDSQRO.js} +1 -1
  44. package/dist/chunks/{notify-LTV7F634.js → notify-NQNNOBFC.js} +1 -1
  45. package/dist/chunks/{own-OJAQ5FRQ.js → own-LYJ5WMGC.js} +1 -1
  46. package/dist/chunks/{pdfium-7HNCQ3K3.js → pdfium-BAMNBCNW.js} +1 -1
  47. package/dist/chunks/{preset-command-VP5RAXBG.js → preset-command-J7RTNKQI.js} +1 -1
  48. package/dist/chunks/{registry-E5PNQWOZ.js → registry-WZUVZQHU.js} +1 -1
  49. package/dist/chunks/{server-EFNTD7ZW.js → server-HQC6RCTV.js} +3 -3
  50. package/dist/chunks/{theme-NF3LQHPV.js → theme-NQIVXDUH.js} +1 -1
  51. package/dist/chunks/{transcribe-CQFHXBTV.js → transcribe-IZGN5EFT.js} +1 -1
  52. package/dist/chunks/{transcribe-command-ZXB3JJFZ.js → transcribe-command-TMM4RLJD.js} +1 -1
  53. package/dist/chunks/{update-note-CJ5XYKYH.js → update-note-BEM4E3NI.js} +1 -1
  54. package/dist/chunks/{watch-command-ZNMO4SF7.js → watch-command-4TATMV2T.js} +1 -1
  55. package/dist/index.js +9 -9
  56. package/package.json +3 -15
  57. package/dist/chunks/chunk-M6LYLTFH.js +0 -3
  58. package/dist/chunks/chunk-RXI6QLNY.js +0 -82
  59. package/dist/chunks/chunk-SNFUGJ3M.js +0 -3
  60. package/dist/chunks/chunk-T37DEXUI.js +0 -3
  61. package/dist/chunks/chunk-TARDT6LZ.js +0 -55
  62. package/dist/chunks/chunk-ZHNPBRCX.js +0 -3
  63. package/dist/chunks/clip-command-SLSAWJF4.js +0 -3
  64. package/dist/chunks/command-DMGGGAPS.js +0 -3
  65. package/dist/chunks/execute-NEDE4JM6.js +0 -3
  66. package/dist/chunks/launch-5JMWS5CI.js +0 -17
@@ -1,82 +0,0 @@
1
- import { createRequire as __forgeCreateRequire } from 'node:module';
2
- const require = __forgeCreateRequire(import.meta.url);
3
- import{A as ge,B as le,C as pe,D as he,a,b as te,c as re,d as k,e as $,f as O,g as D,h as ie,j as oe,k as l,l as A,m as se,n as x,o as H,p as ae,q as E,r as L,s as R,t as ce,u as I,v as ue,w as fe,x as me,y as de,z as B}from"./chunk-TARDT6LZ.js";import{r as M}from"./chunk-BIBDLXCG.js";import{execFile as Ye}from"node:child_process";import{chmodSync as Q,existsSync as Ie,mkdirSync as Z,readdirSync as be,readFileSync as N,rmdirSync as qe,rmSync as p,writeFileSync as We}from"node:fs";import{dirname as P,join as c}from"node:path";var je={convert:"#55c7d9",compress:"#79c98b",edit:"#b39ae8",pdf:"#ff6b4a"},_e="#55c7d9",Ge="#a68ce0",Te=4/5,Je=(e,n,t,i)=>`<path fill="${i}" d="M${e} ${n}h${4*t}v${t}h${-3*t}v${t}h${2*t}v${t}h${-2*t}v${2*t}h${-t}z"/>`;function Ke(e,n){let t=n<=20,i=t?3:4,r=t?6:4.6,o=t?51:51.5,m=Array.from({length:i},(g,w)=>o-(i-1-w)*r).map(g=>`<line x1="${g}" y1="66" x2="${g+66*Te}" y2="0"/>`).join(""),u=e==="forge"?"url(#w)":je[e];return`<svg width="${n}" height="${n}" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="w" gradientUnits="userSpaceOnUse" x1="34" y1="0" x2="62" y2="0"><stop offset="0" stop-color="${_e}"/><stop offset="1" stop-color="${Ge}"/></linearGradient><clipPath id="c"><rect width="64" height="64" rx="14"/></clipPath><clipPath id="i"><rect x="1.5" y="1.5" width="61" height="61" rx="12.5"/></clipPath></defs><g clip-path="url(#c)"><rect width="64" height="64" fill="#1e1e1e"/><g clip-path="url(#i)" stroke="${u}" stroke-width="${t?3.6:2.4}">${m}</g>${Je(16,12,8,"#e7e7e7")}</g><rect x=".75" y=".75" width="62.5" height="62.5" rx="13.5" fill="none" stroke="#3a3a3a" stroke-width="1.5"/></svg>`}async function v(e,n){let{default:t}=await import("sharp");return t(Buffer.from(Ke(e,n))).png().toBuffer()}function ye(e){let n=Buffer.alloc(6);n.writeUInt16LE(0,0),n.writeUInt16LE(1,2),n.writeUInt16LE(e.length,4);let t=6+16*e.length,i=e.map(({size:r,png:o})=>{let s=Buffer.alloc(16);return s[0]=r>=256?0:r,s[1]=r>=256?0:r,s.writeUInt16LE(1,4),s.writeUInt16LE(32,6),s.writeUInt32LE(o.length,8),s.writeUInt32LE(t,12),t+=o.length,s});return Buffer.concat([n,...i,...e.map(r=>r.png)])}function h(e){let n=[{action:"open",label:"Open Forge",kinds:["image","folder"],window:!0,paint:"forge"},{action:"convert",label:"Convert in Forge",kinds:["image","folder"],window:!0,paint:"convert"},{action:"compress",label:"Compress in Forge",kinds:["image","folder"],window:!0,paint:"compress"},{action:"sharpen",label:"Sharpen in Forge",kinds:["image"],window:!1,paint:"edit"},{action:"open-pdf",label:"Open in Forge",kinds:["pdf"],window:!0,paint:"pdf"}],t=(e.presets??[]).map(i=>({action:"preset",preset:i,label:`${i} in Forge`,kinds:["image"],window:!1,paint:"forge"}));return[...e.sharpen?n:n.filter(i=>i.action!=="sharpen"),...t]}var U="Forge was uninstalled",j="Its menu items are removed.",we="Forge could not start",$e="Run forge in a terminal once to set its menu up again.";function xe(e){let{osascript:n,pbs:t}=e.tools??{osascript:"/usr/bin/osascript",pbs:"/System/Library/CoreServices/pbs"},i=[e.node,...e.execArgv,e.forge].map(a).join(" "),[r,o]=$({on:[],off:e.services,osascript:n}),s=[r,...o].map(a).join(" "),m=(u,g)=>`${a(n)} -e 'display notification "${g}" with title "${u}"'`;return`#!/bin/sh
4
- # Forge's right-click menu. Rewritten by Forge whenever it sets the menu up.
5
- if [ ! -f ${a(e.forge)} ]; then
6
- # Forge is gone: take its menu with it, and say so once.
7
- ${e.bundles.map(u=>` rm -rf ${a(u)}`).join(`
8
- `)}
9
- rm -rf ${a(e.menuDir)}
10
- ${s}
11
- ${a(t)} -update
12
- ${m(U,j)}
13
- exit 0
14
- fi
15
- if [ ! -x ${a(e.node)} ]; then
16
- ${m(we,$e)}
17
- exit 1
18
- fi
19
- ${e.xdgConfigHome===void 0?"":`export XDG_CONFIG_HOME=${a(e.xdgConfigHome)}
20
- `}exec ${i} menu run "$@"
21
- `}function ve(e){let n=e.xdgConfigHome===void 0?{}:{XDG_CONFIG_HOME:e.xdgConfigHome};return`// Forge's right-click menu. Rewritten by Forge whenever it sets the menu up.
22
- import { execFileSync, spawn } from 'node:child_process'
23
- import { existsSync, rmSync } from 'node:fs'
24
-
25
- const FORGE = ${JSON.stringify(e.forge)}
26
- const ARGS = ${JSON.stringify(e.execArgv)}
27
- const MENU = ${JSON.stringify(e.menuDir)}
28
- const KEYS = ${JSON.stringify(e.keys)}
29
- const ENV = ${JSON.stringify(n)}
30
-
31
- if (existsSync(FORGE)) {
32
- const child = spawn(process.execPath, [...ARGS, FORGE, 'menu', 'run', ...process.argv.slice(2)], {
33
- stdio: 'inherit',
34
- windowsHide: true,
35
- env: { ...process.env, ...ENV },
36
- })
37
- child.on('exit', (code) => process.exit(code ?? 0))
38
- } else {
39
- // Forge is gone: say so while its app ID still exists, then take the menu with it.
40
- try {
41
- execFileSync('powershell.exe', ['-NoProfile', '-NonInteractive', '-ExecutionPolicy', 'Bypass', '-Command', ${JSON.stringify(he(U,j))}], { windowsHide: true })
42
- } catch {}
43
- for (const key of KEYS) {
44
- try {
45
- execFileSync('reg.exe', ['delete', key, '/f'], { windowsHide: true, stdio: 'ignore' })
46
- } catch {}
47
- }
48
- rmSync(MENU, { recursive: true, force: true })
49
- }
50
- `}function Ve(){return`say() {
51
- if command -v notify-send >/dev/null 2>&1; then
52
- notify-send --app-name=Forge -- "$1" "$2" >/dev/null 2>&1
53
- elif command -v gdbus >/dev/null 2>&1; then
54
- ${["gdbus call --session --dest org.freedesktop.Notifications","--object-path /org/freedesktop/Notifications","--method org.freedesktop.Notifications.Notify",`Forge 0 "''" "\\"$1\\"" "\\"$2\\"" '[]' '{}' -1`].join(" ")} >/dev/null 2>&1
55
- fi
56
- }`}function Se(e){let n=[e.node,...e.execArgv,e.forge].map(a).join(" "),t=e.files.map(a).join(` \\
57
- `),i="";if(e.thunar!==void 0){let r=a(e.thunar.file),o=a(`${e.thunar.file}.forge-tmp`),s=a(e.thunar.seed),m=['/<action>/ { held = ""; holding = 1 }',`holding { held = held $0 "\\n"; if (/<\\/action>/) { holding = 0; if (held !~ /<unique-id>${e.marker}-/) printf "%s", held }; next }`,"{ print }"].join(`
58
- `);i=` if [ -f ${r} ] && grep -qF '<unique-id>${e.marker}-' ${r}; then
59
- awk ${a(m)} ${r} > ${o} && mv -f ${o} ${r}
60
- if [ -f ${s} ] && cmp -s ${s} ${r}; then rm -f ${r}; fi
61
- fi
62
- `}return`#!/bin/sh
63
- # Forge's right-click menu. Rewritten by Forge whenever it sets the menu up.
64
- ${Ve()}
65
- if [ ! -f ${a(e.forge)} ]; then
66
- # Forge is gone: take its menu with it, and say so once.
67
- for f in ${t}; do
68
- if [ -f "$f" ] && grep -qF ${a(e.marker)} "$f"; then rm -f "$f"; fi
69
- done
70
- ${i}${e.folders.map(r=>` rmdir ${a(r)} 2>/dev/null
71
- `).join("")} rm -rf ${a(e.menuDir)}
72
- say ${a(U)} ${a(j)}
73
- exit 0
74
- fi
75
- if [ ! -x ${a(e.node)} ]; then
76
- say ${a(we)} ${a($e)}
77
- exit 1
78
- fi
79
- ${e.xdgConfigHome===void 0?"":`export XDG_CONFIG_HOME=${a(e.xdgConfigHome)}
80
- `}exec ${n} menu run "$@"
81
- `}var b="HKCU\\Software\\Classes",Me=`${b}\\SystemFileAssociations\\image\\shell\\Forge`,ke=`${b}\\Directory\\shell\\Forge`,G=`${b}\\SystemFileAssociations\\.pdf\\shell\\ForgeOpen`,De=`${b}\\AppUserModelId\\${le}`,J=()=>[Me,ke,G,De],K=e=>`${e.paint}.ico`;function Ee(e){let n=o=>`conhost.exe --headless "${e.node}" "${e.menuDir}\\run.mjs" ${o.action}${o.preset===void 0?"":` ${o.preset}`} "%1"`,t=o=>`${e.menuDir}\\${K(o)}`,i=(o,s)=>{let m=e.items.filter(u=>u.kinds.includes(s));return m.length===0?[]:[{key:o,values:{MUIVerb:"Forge",Icon:t({paint:"forge"}),SubCommands:""}},...m.flatMap((u,g)=>{let w=u.preset===void 0?u.action:`preset-${u.preset}`,f=`${o}\\shell\\${g+1}${w}`;return[{key:f,values:{MUIVerb:u.label,Icon:t(u)}},{key:`${f}\\command`,values:{"":n(u)}}]})]},r=e.items.find(o=>o.kinds.includes("pdf"));return[...i(Me,"image"),...i(ke,"folder"),...r?[{key:G,values:{MUIVerb:r.label,Icon:t(r)}},{key:`${G}\\command`,values:{"":n(r)}}]:[],{key:De,values:{DisplayName:"Forge",IconUri:`${e.menuDir}\\forge.png`}}]}var T=e=>`'${pe(e)}'`,_=e=>T(`Registry::${e.replace(/^HKCU\\/,"HKEY_CURRENT_USER\\")}`);function V(e){return["$ErrorActionPreference = 'Stop'",...J().map(t=>`Remove-Item -Path ${_(t)} -Recurse -Force -ErrorAction SilentlyContinue`),...e.flatMap(({key:t,values:i})=>[`New-Item -Path ${_(t)} -Force | Out-Null`,...Object.entries(i).map(([r,o])=>`Set-ItemProperty -LiteralPath ${_(t)} -Name ${T(r===""?"(default)":r)} -Value ${T(o)}`)])].join(`
82
- `)}var vn=(e,n)=>e.version===n.version&&e.forge===n.forge&&e.node===n.node&&e.execArgv.join("\0")===n.execArgv.join("\0")&&e.xdgConfigHome===n.xdgConfigHome&&(e.presets??[]).join("\0")===(n.presets??[]).join("\0"),Fe="/System/Library/CoreServices/pbs",Pe=e=>c(e.menuDir,"state.json"),S=e=>c(e.home,"Library","Services"),q=e=>h({sharpen:!0}).map(n=>c(S(e),`${n.label}.workflow`)),W=()=>h({sharpen:!0}).map(k);function Ne(e){let n;try{n=be(S(e)).filter(t=>t.endsWith(".workflow"))}catch{return[]}return n.flatMap(t=>{let i=c(S(e),t);try{let r=N(c(i,"Contents","Info.plist"),"utf8"),o=/<key>CFBundleIdentifier<\/key>\s*<string>([^<]*)<\/string>/.exec(r)?.[1],s=/<key>CFBundleName<\/key>\s*<string>([^<]*)<\/string>/.exec(r)?.[1];return!o?.startsWith(re)||s===void 0?[]:[{path:i,key:`${o} - ${(u=>u.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&"))(s)} - runWorkflowAsService`}]}catch{return[]}})}function Xe(e){try{return JSON.parse(N(Pe(e),"utf8"))}catch{return}}var Sn=e=>Xe(e)!==void 0,d=(e,n)=>{Z(P(e),{recursive:!0}),We(e,n)};async function Mn(e){if(!Qe(e.platform))return;let n=h({sharpen:e.sharpen,presets:e.presets??[]});if(Z(e.menuDir,{recursive:!0}),e.platform==="linux")await nn(e,n);else if(e.platform==="darwin"){let i=c(e.menuDir,"run"),r=n.filter(f=>f.preset!==void 0),o=r.map(f=>c(S(e),O(f,i).name));d(i,xe({...e,bundles:[...q(e),...o],services:[...W(),...r.map(k)]})),Q(i,493);let s=Ne(e);for(let f of[...q(e),...s.map(C=>C.path)])p(f,{recursive:!0,force:!0});let m=new Map,{default:u}=await import("sharp");for(let f of n){m.has(f.paint)||m.set(f.paint,await u(await v(f.paint,64)).tiff().toBuffer());let{name:C,files:Re}=O(f,i),ne=c(S(e),C);for(let[Be,Ue]of Object.entries(Re))d(c(ne,Be),Ue);d(c(ne,"Contents","Resources",`${te}.tiff`),m.get(f.paint))}let g=n.map(k),w=new Set([...W(),...s.map(f=>f.key)]);await e.run(...$({on:g,off:[...w].filter(f=>!g.includes(f))})),await e.run(Fe,["-update"])}else{d(c(e.menuDir,"run.mjs"),ve({...e,keys:J()}));for(let i of Ce){let r=await Promise.all([16,24,32,48,256].map(async o=>({size:o,png:await v(i,o)})));d(c(e.menuDir,K({paint:i})),ye(r))}d(c(e.menuDir,"forge.png"),await v("forge",256)),await e.run("powershell.exe",Le(V(Ee({...e,items:n}))))}let t={version:e.version,forge:e.forge,node:e.node,execArgv:e.execArgv,...e.xdgConfigHome===void 0?{}:{xdgConfigHome:e.xdgConfigHome},...e.presets&&e.presets.length>0?{presets:[...e.presets]}:{}};d(Pe(e),JSON.stringify(t))}var Qe=e=>e==="darwin"||e==="win32"||e==="linux",Ce=["forge","convert","compress","edit","pdf"],Oe=e=>ie({home:e.home,...e.xdgDataHome===void 0?{}:{xdgDataHome:e.xdgDataHome},...e.xdgConfigHome===void 0?{}:{xdgConfigHome:e.xdgConfigHome},...e.xdgConfigDirs===void 0?{}:{xdgConfigDirs:e.xdgConfigDirs}});function X(e){let n=h({sharpen:!0}),t=n.map(r=>r.action),i=(r,o)=>{try{return be(r).filter(o).map(s=>c(r,s))}catch{return[]}};return[...new Set([...n.map(r=>c(l(e),A(r))),...i(l(e),()=>!0),...n.map(r=>c(x(e),H(r,t))),...i(x(e),r=>r.startsWith("forge-")&&r.endsWith(".nemo_action")),...R.map(r=>c(E(e),L(r)))])]}var y=e=>{try{return N(e,"utf8")}catch{return}};function Ae(e){for(let n of e)y(n)?.includes(D)&&p(n,{force:!0})}var He=e=>c(e.menuDir,"made.json"),z=e=>{try{return JSON.parse(N(He(e),"utf8"))}catch{return[]}};function F(e,n){let t=[];for(let i=n;!Ie(i)&&P(i)!==i;i=P(i))t.push(i);t.length!==0&&(Z(n,{recursive:!0}),d(He(e),JSON.stringify([...new Set([...z(e),...t])])))}function Ze(e){for(let n of[...e].sort((t,i)=>i.length-t.length))try{qe(n)}catch{}}var ee=e=>c(e.menuDir,"thunar-seed.xml");async function ze(e,n,t,i){let r=I(n),o=y(r);if(o===void 0){if(!ge(n,e.path,Ie))return;o=ue(n).map(y).find(m=>m!==void 0&&B(m,"")!==void 0)??fe,d(ee(e),o),F(e,P(r))}let s=B(o,me(t,{launcher:i,menuDir:e.menuDir}));s!==void 0&&s!==y(r)&&await M(r,Buffer.from(s))}async function en(e,n){let t=I(n),i=y(t);if(i===void 0||!i.includes(`<unique-id>${D}-`))return;let r=de(i);r===y(ee(e))?p(t,{force:!0}):await M(t,Buffer.from(r))}async function Y(e,n,t=!1){await M(e,Buffer.from(n)),t&&Q(e,493)}async function nn(e,n){let t=Oe(e),i=c(e.menuDir,"run");for(let o of Ce)d(c(e.menuDir,oe({paint:o})),await v(o,128));Ae(X(t));let r=h({sharpen:!0}).map(o=>o.action);F(e,l(t));for(let o of n)await Y(c(l(t),A(o)),se(o,i),!0);F(e,x(t));for(let o of n)await Y(c(x(t),H(o,r)),ae(o,i));F(e,E(t));for(let o of R){let s=ce(o,n,{launcher:i,menuDir:e.menuDir});s!==void 0&&await Y(c(E(t),L(o)),s,!0)}await ze(e,t,n,i),d(i,Se({...e,files:X(t),folders:[...new Set([l(t),...z(e)])].sort((o,s)=>s.length-o.length),marker:D,thunar:{file:I(t),seed:ee(e)}})),Q(i,493)}async function tn(e){let n=Oe(e);Ae(X(n)),await en(e,n),Ze([l(n),...z(e)]),p(e.menuDir,{recursive:!0,force:!0})}async function kn(e){if(e.platform==="linux")await tn(e);else if(e.platform==="darwin"){let n=Ne(e);for(let i of[...q(e),...n.map(r=>r.path)])p(i,{recursive:!0,force:!0});p(e.menuDir,{recursive:!0,force:!0});let t=new Set([...W(),...n.map(i=>i.key)]);await e.run(...$({on:[],off:[...t]})),await e.run(Fe,["-update"])}else e.platform==="win32"&&(p(e.menuDir,{recursive:!0,force:!0}),await e.run("powershell.exe",Le(V([]))))}var Le=e=>["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-Command",e],Dn=(e,n)=>new Promise((t,i)=>{Ye(e,n,{timeout:6e4,windowsHide:!0},r=>r?i(r):t())});export{vn as a,Xe as b,Sn as c,Mn as d,Qe as e,kn as f,Dn as g};
@@ -1,3 +0,0 @@
1
- import { createRequire as __forgeCreateRequire } from 'node:module';
2
- const require = __forgeCreateRequire(import.meta.url);
3
- import{c as a}from"./chunk-VLVNA4T3.js";import{dirname as l,sep as f}from"node:path";var p=2e4,g=t=>t>=p;function u(t,o){return{made:t.map(i=>({from:i.job.sources.map(e=>e.path),to:i.job.outputs})),failed:o.map(i=>({path:i.path,message:i.error.message}))}}var d=t=>t.length===1?a(t[0]):`${t.length} files`;function m(t){let[o,...i]=t.map(s=>l(s).split(f)),e=o??[];for(let s of i){let n=0;for(;n<e.length&&e[n]===s[n];)n++;e=e.slice(0,n)}return e.join(f)||f}function y(t,o){let i=o.made.length+o.failed.length;if(i===0)return;let[e]=o.failed,s=e&&(e.path?`${a(e.path)}: `:"")+e.message;if(i===1){let[r]=o.made;return r?{title:`${t} finished`,body:`${d(r.from)} \u2192 ${d(r.to)}`}:{title:`${t} failed`,body:s??""}}let n=`${t} finished ${o.made.length} of ${i} files`;return s!==void 0?{title:n,body:s}:{title:n,body:`Saved to ${a(m(o.made.flatMap(r=>r.to)))}`}}export{g as a,u as b,y as c};
@@ -1,3 +0,0 @@
1
- import { createRequire as __forgeCreateRequire } from 'node:module';
2
- const require = __forgeCreateRequire(import.meta.url);
3
- import{d as E,k as F}from"./chunk-J6AZTW62.js";import{n as te,o as A,q as re}from"./chunk-BIBDLXCG.js";import{a as ie,b as oe,c as ne,d as ae,e as se,f as he,g as I}from"./chunk-7KYO62XK.js";import{B as j,E as O,J as X,X as G,a as b,aa as H,b as L,c as P,ca as K,d as z,da as Q,e as _,ea as Y,f as N,fa as Z,g as $,ga as ee,h as D,i as q,ka as x,l as U,m as W,n as V,t as J,u as S}from"./chunk-CVNYUROW.js";import{c as y}from"./chunk-VLVNA4T3.js";import{a as f}from"./chunk-H3DIRJFE.js";import{b as w}from"./chunk-KXKQDFHX.js";import{constants as be}from"node:fs";import{access as Se,readFile as xe,rm as Ee,stat as Ie,writeFile as ve}from"node:fs/promises";import{dirname as ze}from"node:path";function Ue(e){if(f[e].hasAlpha)return;let r=Object.keys(f).filter(t=>f[t].hasAlpha&&t!=="heic").join(", ");return O(`${f[e].label} cannot hold transparency, so a cutout cannot be saved as one.`,`Choose a format that can: ${r}.`)}var ce="1.1.0";function fe(e,r){let t=e.split(".").map(i=>Number.parseInt(i,10)||0),o=r.split(".").map(i=>Number.parseInt(i,10)||0);for(let i=0;i<Math.max(t.length,o.length);i++){let a=(t[i]??0)-(o[i]??0);if(a!==0)return a>0}return!0}var ge="1.4.0";function We(e){return e!==void 0&&fe(e,ge)}function M(e){return e!==void 0&&fe(e,ce)?[2,3,4]:[2,4]}function Ve(e,r,t){if(e===1||M(r).some(i=>i===e))return;if(t!==void 0&&M(t).some(i=>i===e))return X("boost",`boost ${e}\xD7`,r,ce);let o=M(r).map(i=>`--boost ${i}`);return O(`No released boost makes ${e}\xD7 yet.`,`Try ${o.slice(0,-1).join(", ")} or ${o.at(-1)}.`)}var le=16384,ye=1e8;function de(e,r,t){let o=Math.max(e,r)*t;if(o>le)return{side:o};let i=e*t*r*t;if(i>ye)return{megapixels:Math.round(i/1e6)}}var u=e=>Math.max(1,Math.round(e));function T(e,r){return"percent"in r?{width:u(e.width*r.percent/100),height:u(e.height*r.percent/100)}:"width"in r?{width:u(r.width),height:u(e.height*r.width/e.width)}:{width:u(e.width*r.height/e.height),height:u(r.height)}}function pe(e){return de(e.width,e.height,1)}var Oe=new Set(["jpeg","png","webp","avif","heic","raw","gif","tiff"]),Fe=new Set(["jpeg","png","webp","avif","gif","tiff"]),Ae={jpeg:"jpeg",png:"png",webp:"webp",gif:"gif",tiff:"tiff"};function Me(e,r){if(r.format==="heif")return r.compression==="av1"?"avif":"heic";let t=Ae[r.format??""];if(!t)throw q(e,r.format??"an unknown format");return t}async function Te(e){let r;try{r=await Ie(e)}catch(a){let s=a.code;throw s==="ENOENT"?L(e):s==="EACCES"||s==="EPERM"?z(e):s==="ENOTDIR"?_(e):s==="ELOOP"?N(e):s==="ENAMETOOLONG"?$(e):D(e,a)}if(!r.isFile())throw P(e);try{await Se(e,be.R_OK)}catch{throw z(e)}if(await oe(e)){if(!await ie())throw U(e);let a;try{a=await ne(e)}catch(s){throw S(e,"heic",s)}if(a.width===0||a.height===0)throw S(e,"heic",void 0);return{kind:"image",path:e,format:"heic",width:a.width,height:a.height,bytes:r.size,hasAlpha:a.hasAlpha,frames:1}}let t=await ae(e);if(t){if(!await se())throw W(e);let a;try{a=await he(e,t)}catch(s){throw S(e,"raw",s)}if(!a)throw V(e);return{kind:"image",path:e,format:"raw",width:a.width,height:a.height,bytes:r.size,hasAlpha:!1,frames:1}}let o=await w(),i;try{i=await o(e).metadata()}catch(a){throw J(e,a)}return{kind:"image",path:e,format:Me(e,i),width:i.autoOrient?.width??i.width??0,height:i.autoOrient?.height??i.height??0,bytes:r.size,hasAlpha:i.hasAlpha??!1,frames:i.pages??1}}function k(e,r,t,o){let i=t??f[r].defaultQuality;if(o&&f[r].quantisable)return ke(e,r,t,o);switch(r){case"jpeg":return e.jpeg({quality:i,mozjpeg:!0});case"webp":return e.webp({quality:i});case"avif":return e.avif({quality:i});case"png":return e.png({compressionLevel:9});case"gif":return e.gif();case"tiff":return e.tiff({compression:"deflate"});case"heic":throw new Error("heic is not writable; the capability graph should have prevented this");case"raw":throw new Error("raw is not writable; the capability graph should have prevented this");case"pdf":throw new Error("pdf is not an image target; the capability graph should have prevented this");case"docx":throw new Error("docx is not an image target; the capability graph should have prevented this");case"doc":throw new Error("doc is not an image target; the capability graph should have prevented this");default:throw new Error(`${r} is not an image target; the capability graph should have prevented this`)}}function ke(e,r,t,{dither:o}){let i=t??100,a=o?1:0;return r==="gif"?e.gif({interFrameMaxError:Math.round(32*(100-i)/100),dither:a}):e.png({palette:!0,quality:i,dither:a,compressionLevel:9,effort:10})}var R=(e,r)=>e.kind==="image"&&e.frames>1&&f[r].animatable;async function Re(e,r){let t=ze(r);await A(r);let o=te(r);try{return await ve(o,e),await re(o,r),e.length}catch(i){throw await Ee(o,{force:!0}).catch(()=>{}),j(r,i)}}async function g(e,r,t,o,i,a){if(e.kind!=="image")throw new Error("pipelineFor received a non-image source");let s=i??await I(e.path,e.format),n=(await w())(s,o?{animated:!0}:{});if(n=n.rotate(),t.trim&&(n=n.trim()),t.crop){if(!t.crop.box)throw new Error("pipelineFor needs the crop placed (run does it)");n=n.extract(t.crop.box)}if(t.resize){if(!a&&(t.trim||t.crop))throw new Error("pipelineFor needs the resolved size to resize a cut image");let c=a??T(e,t.resize);n=n.resize(c.width,c.height,{fit:"fill"})}return t.rotate&&(n=n.rotate(t.rotate)),e.hasAlpha&&!f[r].hasAlpha&&(n=n.flatten({background:t.background})),n=t.keepMetadata?n.keepMetadata():n.keepIccProfile(),{pipeline:n}}async function st(e,r){let t={background:"#ffffff",keepMetadata:!1},{pipeline:o}=await g(e,"png",t,!1);await o.png({compressionLevel:1}).toFile(r)}async function ht(e,r,t){let{pipeline:o}=await g(e,r,t,R(e,r));return await k(o,r,t.quality,t.compress).toBuffer()}async function Be(e){let r={width:e.width,height:e.height};if(e.frames>1)return{upright:r,trimmed:"animated"};let t=await I(e.path,e.format);try{let o=await w(),{info:i}=await o(t).rotate().trim().jpeg({quality:1}).toBuffer({resolveWithObject:!0});return i.width===r.width&&i.height===r.height?{upright:r,trimmed:"nothing"}:{upright:r,trimmed:{width:i.width,height:i.height}}}catch(o){throw b(o)?o:x(e.path,o)}}var me=1024;async function Ce(e){let r={background:"#ffffff",keepMetadata:!1},{pipeline:t}=await g(e,"png",r,!1);try{let{data:o,info:i}=await t.resize(me,me,{fit:"inside",withoutEnlargement:!0}).ensureAlpha().raw().toBuffer({resolveWithObject:!0}),a=i.width*i.height,s=i.channels,p=new Uint8Array(a*3),n=new Uint8Array(a),c=!1;for(let m=0;m<a;m++){for(let h=0;h<3;h++)p[m*3+h]=o[m*s+(s>=4?h:0)]??0;n[m]=o[m*s+s-1]??255,n[m]!==255&&(c=!0)}return{size:{width:e.width,height:e.height},thumb:{width:i.width,height:i.height,rgb:p,...c?{alpha:n}:{}}}}catch(o){throw b(o)?o:x(e.path,o)}}var ue=128;async function Le(e,r){let{thumb:t,size:o}=e,i=E(t,r),a=await w(),{info:s}=await a(Pe(t),{raw:{width:t.width,height:t.height,channels:3}}).resize(i.width,i.height,{fit:"cover",position:a.strategy.attention}).raw().toBuffer({resolveWithObject:!0}),p=E(o,r),n=Math.round(-(s.cropOffsetLeft??0)*o.width/t.width),c=Math.round(-(s.cropOffsetTop??0)*o.height/t.height);return{...p,left:Math.min(Math.max(n,0),o.width-p.width),top:Math.min(Math.max(c,0),o.height-p.height)}}function Pe(e){let{alpha:r}=e;if(!r)return e.rgb;let t=new Uint8Array(e.rgb.length);for(let o=0;o<t.length;o++){let i=(r[Math.floor(o/3)]??255)/255;t[o]=Math.round(ue+((e.rgb[o]??0)-ue)*i)}return t}async function _e(e,r){if(e.op!=="convert")throw new Error(`image engine cannot ${e.op}`);let t=e.sources[0],o=e.outputs[0];if(t.kind!=="image")throw new Error("the image engine cannot convert a document source");let i=f[e.target],a=[];r({phase:"reading"});let s=t.frames>1,p=R(t,e.target);s&&!i.animatable&&a.push({code:"animation-flattened",message:`${y(t.path)} has ${t.frames} frames, and ${i.label} cannot animate. Only the first frame was converted.`});let n=e.options,c;if(n.rotate&&s)throw ee(t.path);if(n.trim||n.crop||n.resize){let h={width:t.width,height:t.height};if(n.trim&&n.crop)throw new Error("a job cannot both trim and crop");if(n.crop){if(s)throw Z(t.path);let{aspect:d}=n.crop,B=v=>v.width===t.width&&v.height===t.height,C=E(h,d),l=n.crop.box??(B(C)?C:await Le(await Ce(t),d));if(B(l)){if(!n.resize)throw Y(t.path,F(d));a.push({code:"nothing-cropped",message:`${y(t.path)} is already ${F(d)}; resized only.`});let{crop:v,...we}=n;n=we}else n={...n,crop:{aspect:d,box:l}},h={width:l.width,height:l.height}}if(n.trim){if(s)throw Q(t.path);let{trimmed:d}=await Be(t);if(d==="nothing"){if(!n.resize)throw K(t.path);a.push({code:"nothing-trimmed",message:`${y(t.path)} has no empty edges; resized only.`})}else d!=="animated"&&(h=d)}if(n.resize&&(c=T(h,n.resize),pe(c)))throw G(t.path,c)}r({phase:"decoding"});let{pipeline:m}=await g(t,e.target,n,p,void 0,c);try{await A(o),r({phase:"encoding"});let h=await k(m,e.target,n.quality,n.compress).toBuffer();if(n.compress&&h.length>=t.bytes)throw H(t.path,t.bytes,h.length);r({phase:"writing"});let d=await Re(h,o);return{job:e,outputBytes:d,warnings:a}}catch(h){throw b(h)?h:x(t.path,h)}}async function Ne(e){let r=await I(e.path,e.format);return typeof r=="string"?await xe(r):r}async function $e(e){if(e.op!=="convert")return;let r=f[e.target];if(!r.lossy&&!(r.quantisable&&e.options.compress))return;let t=e.sources[0];if(t.kind!=="image")return;let o=await Ne(t);return{ladder:[{}],measure:async i=>{let{pipeline:a}=await g(t,e.target,i,R(t,e.target),o);return(await k(a,e.target,i.quality,i.compress).toBuffer()).length}}}var ct={id:"image",reads:Oe,writes:Fe,ops:new Set(["convert"]),probe:Te,run:_e,measurer:$e};export{Ue as a,We as b,M as c,Ve as d,le as e,de as f,T as g,pe as h,k as i,Re as j,st as k,ht as l,Be as m,Ce as n,Le as o,ct as p};
@@ -1,55 +0,0 @@
1
- import { createRequire as __forgeCreateRequire } from 'node:module';
2
- const require = __forgeCreateRequire(import.meta.url);
3
- import{a as y}from"./chunk-SNFUGJ3M.js";import{execFile as C}from"node:child_process";import{accessSync as v,constants as k}from"node:fs";import{isAbsolute as A,join as a}from"node:path";var S=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");function $(e,t){if(typeof e=="string")return`${t}<string>${S(e)}</string>`;if(typeof e=="number")return`${t}<integer>${e}</integer>`;if(typeof e=="boolean")return`${t}<${e}/>`;if(Array.isArray(e))return`${t}<array>
4
- ${e.map(o=>$(o,`${t} `)).join(`
5
- `)}
6
- ${t}</array>`;let n=Object.entries(e).map(([o,i])=>`${t} <key>${S(o)}</key>
7
- ${$(i,`${t} `)}`);return n.length===0?`${t}<dict/>`:`${t}<dict>
8
- ${n.join(`
9
- `)}
10
- ${t}</dict>`}var h=e=>`<?xml version="1.0" encoding="UTF-8"?>
11
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
12
- <plist version="1.0">
13
- ${$(e,"")}
14
- </plist>
15
- `,T={image:"public.image",folder:"public.folder",pdf:"com.adobe.pdf"};function P(e){return e.length===1&&e[0]==="image"?"com.apple.Automator.fileSystemObject.image":e.length===1&&e[0]==="pdf"?"com.apple.Automator.fileSystemObject.PDF":e.length===1&&e[0]==="folder"?"com.apple.Automator.fileSystemObject.folder":"com.apple.Automator.fileSystemObject"}var u=e=>`'${e.replace(/'/g,"'\\''")}'`,w="forge",D=e=>e.preset===void 0?`com.forge-terminal.menu.${e.action}`:`com.forge-terminal.menu.preset.${e.preset}`,Y="com.forge-terminal.menu.",N="runWorkflowAsService",G=e=>`${D(e)} - ${e.label} - ${N}`,E=`ObjC.import('Foundation')
16
- function run(argv) {
17
- const domain = argv[0]
18
- const defaults = $.NSUserDefaults.standardUserDefaults
19
- const or = (v) => (v.isNil() ? $.NSDictionary.dictionary : v)
20
- const all = $.NSMutableDictionary.dictionaryWithDictionary(or(defaults.persistentDomainForName(domain)))
21
- const status = $.NSMutableDictionary.dictionaryWithDictionary(or(all.objectForKey('NSServicesStatus')))
22
- const on = { presentation_modes: { ContextMenu: true, FinderPreview: true, ServicesMenu: true, TouchBar: true } }
23
- for (const arg of argv.slice(1)) {
24
- const key = arg.slice(1)
25
- if (arg[0] === '+') status.setObjectForKey($(on), key)
26
- else status.removeObjectForKey(key)
27
- }
28
- all.setObjectForKey(status, 'NSServicesStatus')
29
- defaults.setPersistentDomainForName(all, domain)
30
- }`;function Q(e){return[e.osascript??"/usr/bin/osascript",["-l","JavaScript","-e",E,e.domain??"pbs",...e.on.map(t=>`+${t}`),...e.off.map(t=>`-${t}`)]]}function z(e,t){let n=h({CFBundleDevelopmentRegion:"English",CFBundleIdentifier:D(e),CFBundleInfoDictionaryVersion:"6.0",CFBundleName:e.label,CFBundlePackageType:"BNDL",CFBundleShortVersionString:"1.0",CFBundleVersion:"1",NSServices:[{NSIconName:w,NSMenuItem:{default:e.label},NSMessage:N,NSRequiredContext:{NSApplicationIdentifier:"com.apple.finder"},NSSendFileTypes:e.kinds.map(s=>T[s])}]}),o=e.preset===void 0?"":` ${u(e.preset)}`,i=`${u(t)} ${e.action}${o} "$@"`,r=h({AMApplicationBuild:"521",AMApplicationVersion:"2.10",AMDocumentVersion:"2",actions:[{action:{AMAccepts:{Container:"List",Optional:!0,Types:["com.apple.cocoa.path"]},AMActionVersion:"2.0.3",AMApplication:["Automator"],AMParameterProperties:{COMMAND_STRING:{},CheckedForUserDefaultShell:{},inputMethod:{},shell:{},source:{}},AMProvides:{Container:"List",Types:["com.apple.cocoa.string"]},ActionBundlePath:"/System/Library/Automator/Run Shell Script.action",ActionName:"Run Shell Script",ActionParameters:{COMMAND_STRING:i,CheckedForUserDefaultShell:!0,inputMethod:1,shell:"/bin/zsh",source:""},BundleIdentifier:"com.apple.RunShellScript",CFBundleVersion:"2.0.3",CanShowSelectedItemsWhenRun:!1,CanShowWhenRun:!0,Category:["AMCategoryUtilities"],"Class Name":"RunShellScriptAction",InputUUID:"7A1F3C2E-0F4B-4E8A-9C61-5B2D8E4F1A01",OutputUUID:"7A1F3C2E-0F4B-4E8A-9C61-5B2D8E4F1A02",UUID:"7A1F3C2E-0F4B-4E8A-9C61-5B2D8E4F1A03",UnlocalizedApplications:["Automator"]},isViewVisible:!0}],connectors:{},workflowMetaData:{serviceApplicationBundleID:"com.apple.finder",serviceApplicationPath:"/System/Library/CoreServices/Finder.app",serviceInputTypeIdentifier:P(e.kinds),serviceOutputTypeIdentifier:"com.apple.Automator.nothing",serviceProcessesInput:!1,workflowTypeIdentifier:"com.apple.Automator.servicesMenu"}});return{name:`${e.label}.workflow`,files:{"Contents/Info.plist":n,"Contents/document.wflow":r,"Contents/Resources/document.wflow":r}}}var m="forge-terminal-menu";function oe(e){let t=o=>o&&A(o)?o:void 0,n=(e.xdgConfigDirs??"").split(":").filter(o=>A(o));return{dataHome:t(e.xdgDataHome)??a(e.home,".local","share"),configHome:t(e.xdgConfigHome)??a(e.home,".config"),configDirs:n.length>0?n:["/etc/xdg"]}}function x(e,t=process.env.PATH){for(let n of(t??"").split(":"))if(n!=="")try{return v(a(n,e),k.X_OK),!0}catch{}return!1}var I={image:"image/*",folder:"inode/directory",pdf:"application/pdf"},U=e=>e.map(t=>`${I[t]};`).join(""),M=e=>`${e.paint}.png`,ie=e=>a(e.dataHome,"nautilus","scripts","Forge"),f=e=>e.preset===void 0?e.action:`preset-${e.preset}`,g=e=>e.preset===void 0?e.action:`preset ${e.preset}`,re=e=>e.label;function se(e,t){return`#!/bin/sh
31
- # ${m}: Forge's right-click menu, written by Forge. \`forge menu remove\` takes it out.
32
- if [ -n "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" ]; then
33
- IFS='
34
- '
35
- set -f
36
- set -- $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
37
- fi
38
- exec ${u(t)} ${g(e)} "$@"
39
- `}var ae=e=>a(e.dataHome,"nemo","actions"),ce=(e,t)=>`forge-${e.preset===void 0?t.indexOf(e.action)+1:t.length+1}-${f(e)}.nemo_action`,l=e=>e.replace(/%/g,"%%");function ue(e,t){return`[Nemo Action]
40
- # ${m}: Forge's right-click menu, written by Forge. \`forge menu remove\` takes it out.
41
- Name=${l(e.label)}
42
- Comment=${l(e.label)}
43
- Exec=${l(u(t))} ${g(e)} %F
44
- Selection=notnone
45
- Mimetypes=${U(e.kinds)}
46
- `}var pe=e=>a(e.dataHome,"kio","servicemenus"),le=e=>`forge-${e}.desktop`,me=["image","folder","pdf"],_=e=>l(`"${e.replace(/[\\"`$]/g,"\\$&")}"`).replace(/\\/g,"\\\\");function fe(e,t,n){let o=t.filter(c=>c.kinds.includes(e));if(o.length===0)return;let i=o.length>1,r=["[Desktop Entry]",`# ${m}: Forge's right-click menu, written by Forge. \`forge menu remove\` takes it out.`,"Type=Service","ServiceTypes=KonqPopupMenu/Plugin","X-KDE-ServiceTypes=KonqPopupMenu/Plugin",`MimeType=${I[e]};`,`Actions=${o.map(c=>`${f(c)};`).join("")}`,"X-KDE-Priority=TopLevel",...i?["X-KDE-Submenu=Forge",`Icon=${a(n.menuDir,"forge.png")}`]:[]],s=o.map(c=>["",`[Desktop Action ${f(c)}]`,`Name=${c.label}`,`Icon=${a(n.menuDir,M(c))}`,`Exec=${_(n.launcher)} ${g(c)} %F`].join(`
47
- `));return`${[...r,...s].join(`
48
- `)}
49
- `}var ge=e=>a(e.configHome,"Thunar","uca.xml"),de=e=>e.configDirs.map(t=>a(t,"Thunar","uca.xml")),$e=`<?xml version="1.0" encoding="UTF-8"?>
50
- <actions>
51
- </actions>
52
- `,L=e=>`${m}-${f(e)}`,p=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),O={image:{patterns:["*"],type:"image-files"},folder:{patterns:["*"],type:"directories"},pdf:{patterns:["*.pdf","*.PDF"],type:"other-files"}};function xe(e,t){return e.map(n=>{let o=n.kinds.map(s=>O[s]),i=[...new Set(o.flatMap(s=>s.patterns))],r=i.includes("*")?["*"]:i;return["<action>",` <icon>${p(a(t.menuDir,M(n)))}</icon>`,` <name>${p(n.label)}</name>`,` <submenu>${n.kinds.includes("pdf")?"":"Forge"}</submenu>`,` <unique-id>${L(n)}</unique-id>`,` <command>${p(l(u(t.launcher)))} ${g(n)} %F</command>`,` <description>${p(n.label)}</description>`," <range></range>",` <patterns>${p(r.join(";"))}</patterns>`,...o.map(s=>` <${s.type}/>`),"</action>"].join(`
53
- `)}).map(n=>`${n}
54
- `).join("")}var j=/[ \t]*<action>[\s\S]*?<\/action>[ \t]*\r?\n?/g;function R(e){return e.replace(j,t=>t.includes(`<unique-id>${m}-`)?"":t)}function ye(e,t){let n=R(e),o=n.lastIndexOf("</actions>");if(o===-1||!/<actions>/.test(n))return;let i=n.lastIndexOf(`
55
- `,o)+1;return/^[ \t]*$/.test(n.slice(i,o))&&(o=i),`${n.slice(0,o)}${t}${n.slice(o)}`}var Se=(e,t,n)=>x("thunar",t)||n(a(e.configHome,"Thunar"));var B="ForgeTerminal.Forge",F=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),K=e=>e.replace(/['‘’‚‛]/g,"$&$&"),b=K;function H(e,t){return["[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] > $null","[Windows.Data.Xml.Dom.XmlDocument, Windows.Data.Xml.Dom.XmlDocument, ContentType = WindowsRuntime] > $null","$x = New-Object Windows.Data.Xml.Dom.XmlDocument",`$x.LoadXml('<toast><visual><binding template="ToastText02"><text id="1">${b(F(e))}</text><text id="2">${b(F(t))}</text></binding></visual></toast>')`,`[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier('${B}').Show([Windows.UI.Notifications.ToastNotification]::new($x))`].join("; ")}function W(e,t,n=process.platform){return n==="win32"?["powershell.exe",["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-Command",H(e,t)]]:["/usr/bin/osascript",["-e","on run argv","-e","display notification (item 2 of argv) with title (item 1 of argv)","-e","end run",e,t]]}var d=e=>`"${e.replace(/[\\"]/g,"\\$&").replace(/\n/g,"\\n")}"`;function X(e,t,n={}){let o=n.has??(i=>x(i));if(o("notify-send"))return["notify-send",["--app-name=Forge",...n.icon?[`--icon=${n.icon}`]:[],"--",e,t]];if(o("gdbus"))return["gdbus",["call","--session","--dest","org.freedesktop.Notifications","--object-path","/org/freedesktop/Notifications","--method","org.freedesktop.Notifications.Notify",d("Forge"),"0",d(n.icon??""),d(e),d(t),"[]","{}","-1"]]}function V(e,t,n=process.platform,o={}){let i=n==="linux"?X(e,t,o):W(e,t,n);return new Promise(r=>{if(i===void 0)return r();try{C(i[0],i[1],{timeout:1e4,windowsHide:!0},()=>r())}catch{r()}})}var q=(e,t)=>new Promise((n,o)=>C(e,t,{timeout:2e3},(i,r)=>i?o(i):n(r)));async function J(e,t=q){let n=(await t("lsappinfo",["front"])).trim();return(await t("lsappinfo",["info","-only","bundleid",n])).match(/bundleID="([^"]*)"/)?.[1]===e}async function Ie(e,t,n={}){if(e===void 0||!y(t))return;let o=n.platform??process.platform,i=n.env??process.env;if(i.FORGE_NO_NOTIFY||i.SSH_CONNECTION||i.SSH_TTY)return;let r=i.__CFBundleIdentifier;o==="darwin"&&r&&await J(r,n.ask).catch(()=>!1)||await(n.post??((s,c)=>V(s,c,o)))(e.title,e.body)}export{u as a,w as b,Y as c,G as d,Q as e,z as f,m as g,oe as h,x as i,M as j,ie as k,re as l,se as m,ae as n,ce as o,ue as p,pe as q,le as r,me as s,fe as t,ge as u,de as v,$e as w,xe as x,R as y,ye as z,Se as A,B,K as C,H as D,W as E,d as F,X as G,V as H,J as I,Ie as J};
@@ -1,3 +0,0 @@
1
- import { createRequire as __forgeCreateRequire } from 'node:module';
2
- const require = __forgeCreateRequire(import.meta.url);
3
- import{a as h,c as Q}from"./chunk-Q6KQWJ4J.js";import{d as L,f as b,g as X}from"./chunk-R24JCIZ5.js";import{a as J,b as _,e as R}from"./chunk-XPATZLEH.js";import{a as U,b as w}from"./chunk-DYIATUFE.js";import{a as g,d as A}from"./chunk-N6RCLJE6.js";import{g as l}from"./chunk-T37DEXUI.js";import{d as x,l as I}from"./chunk-J6AZTW62.js";import{b as $,c as N,d as D,e as d,i as B,m as z}from"./chunk-BIBDLXCG.js";import{E as k,s as C}from"./chunk-CVNYUROW.js";import{a as p,b as E,c as j}from"./chunk-H3DIRJFE.js";var O=t=>t.length>0&&t.every(e=>e.kind==="image")?t:void 0;function Bt(t,e){let n=J(t);return n.includes(e)?void 0:C(t,e,n)}function G(t){return{target:t.target??"png",background:typeof t.background=="string"?t.background:"#ffffff",keepMetadata:t.keepMetadata===!0,...typeof t.output=="string"?{output:t.output}:{},...t.roots instanceof Map?{roots:t.roots}:{},...typeof t.quality=="number"?{quality:t.quality}:{}}}var W=()=>({kind:"select",id:"target",label:"Save as",default:"png",choices:[{value:"png",label:"PNG",hint:p.png.hint}]}),ot=t=>t===1?"sharp":`${t}x`,it=t=>t===1||t===3||t===4?t:2,Jt={id:"boost",label:"Boost resolution",verb:"Boosting",hint:"sharper, at its size or at 2\xD7, 3\xD7 or 4\xD7",requires:"boost",appliesTo:t=>O(t)!==void 0,unavailable:()=>"images only",options:()=>[{kind:"select",id:"scale",label:"Scale",default:"2",choices:[{value:"1",label:"Sharpen",hint:"the same size, sharper"},{value:"2",label:"2\xD7",hint:"twice the width and height"},{value:"3",label:"3\xD7",hint:"three times the width and height"},{value:"4",label:"4\xD7",hint:"four times the width and height"}]},W()],plan(t,e){let n=O(t);if(!n)return[];let o=G(e),i=it(Number(e.scale??2));return n.map(r=>({op:"boost",sources:[r],outputs:[d({sourcePath:r.path,target:o.target,suffix:ot(i),...o.output===void 0?{}:{output:o.output},...o.roots?.get(r.path)===void 0?{}:{sourceRoot:o.roots.get(r.path)}})],scale:i,target:o.target,options:{background:o.background,keepMetadata:o.keepMetadata,...o.quality===void 0?{}:{quality:o.quality}}}))}},_t={id:"remove-background",label:"Remove background",verb:"Removing",hint:"cut out the subject",requires:"remove-background",appliesTo:t=>O(t)!==void 0,unavailable:()=>"images only",options:()=>[W()],plan(t,e){let n=O(t);if(!n)return[];let o=G(e);return n.map(i=>({op:"remove-background",sources:[i],outputs:[d({sourcePath:i.path,target:o.target,suffix:"cutout",...o.output===void 0?{}:{output:o.output},...o.roots?.get(i.path)===void 0?{}:{sourceRoot:o.roots.get(i.path)}})],target:o.target,options:{background:o.background,keepMetadata:o.keepMetadata,...o.quality===void 0?{}:{quality:o.quality}}}))}};var rt=[{degrees:90,label:"90\xB0 right",suffix:"rotated-right"},{degrees:180,label:"180\xB0",suffix:"rotated-180"},{degrees:270,label:"90\xB0 left",suffix:"rotated-left"}],y=t=>t===90||t===180||t===270,Ut=(t,e)=>e===180?{...t}:{width:t.height,height:t.width},M=t=>rt.find(e=>e.degrees===t).suffix;import{dirname as at,join as H}from"node:path";var K="Same location",V="New subfolder";function st(t,e,n){return t===e?K:t===g("Desktop")?"Desktop":t===g("Downloads")?"Downloads":e!==void 0&&n!==void 0&&t===H(e,n)?V:h(t)||t}function T(t,e,n={}){return pt(at(t.path),e,n)}function pt(t,e,{subfolder:n}={}){let o=A(e.defaultOutput),i=e.lastOutput?A(e.lastOutput):void 0,r=f=>({label:st(f,t,n),path:f}),a=[r(o),...i?[r(i)]:[],r(g("Desktop")),...t===void 0?[]:[{label:K,path:t}],r(g("Downloads")),...n!==void 0&&t!==void 0?[{label:V,path:H(t,n)}]:[]],u=new Set,s=a.filter(f=>u.has(f.path)?!1:(u.add(f.path),!0));return{kind:"path",id:"destination",label:"Save to",default:o,presets:s,...i&&i!==o?{last:i}:{}}}var c=t=>typeof t=="string"&&t!==""?t:void 0;var ee=[2,1.5,1.25,.75,.5],ut=.25,dt=4,Y=-16;function q(t){return{wav:"m4a",aiff:"m4a",flac:"m4a",avi:"mp4",ogg:"opus"}[t]??t}var Z=t=>t.length===1&&t[0]?.kind==="media"?t[0]:void 0,ft=t=>t==="cut"||t==="mute"||t==="speed"||t==="resize"||t==="crop"||t==="rotate"||t==="loudness"||t==="extract"||t==="cleanup";function ct(t,e){let n=e.media??{},o=t.facts?.video,i=[];return e.extract&&i.push("audio"),n.cut&&i.push("trimmed"),n.mute&&i.push("muted"),n.cleanup?i.push("cleaned"):n.loudness!==void 0&&i.push("levelled"),n.speed!==void 0&&i.push(`${n.speed}x`),n.fps!==void 0&&i.push(`${n.fps}fps`),n.bitrate!==void 0&&i.push(`${n.bitrate}k`),e.crop&&i.push(I(e.crop.aspect)),e.resize&&i.push(o?b(l(o,e.resize)):"resized"),e.rotate&&i.push(M(e.rotate)),i.length===1?i[0]:"edited"}function mt(t,e){return t.map(n=>{let o=e.target??n.format,i={background:"#ffffff",keepMetadata:!1};e.media&&Object.keys(e.media).length&&(i.media=e.media),e.resize&&(i.resize=e.resize),e.rotate&&(i.rotate=e.rotate);let r=n.facts?.video;e.crop&&r&&(i.crop={aspect:e.crop.aspect,box:e.crop.box??x(r,e.crop.aspect)});let a=e.roots?.get(n.path),u=d({sourcePath:n.path,target:o,suffix:ct(n,e),...e.output===void 0?{}:{output:e.output},...a===void 0?{}:{sourceRoot:a}});return{op:"convert",sources:[n],outputs:[z(u,c(e.destination),c(e.name))],target:o,options:i}})}function S(t){let e={},n=t.cut;return n&&typeof n.start=="number"&&(e.cut={start:n.start,...typeof n.end=="number"?{end:n.end}:{}}),t.mute===!0&&(e.mute=!0),typeof t.speed=="number"&&(e.speed=t.speed),typeof t.fps=="number"&&(e.fps=t.fps),typeof t.bitrate=="number"&&(e.bitrate=t.bitrate),typeof t.loudness=="number"&&(e.loudness=t.loudness),t.cleanup===!0&&(e.cleanup=!0),Object.keys(e).length?e:void 0}var ne={id:"media-edit",label:"Edit",verb:"Editing",hint:"trim, mute, speed, resize, rotate, crop",appliesTo:t=>Z(t)!==void 0,unavailable:()=>"one video or audio file",options:()=>[],plan(t,e){let n=Z(t);if(!n||!ft(e.tool))return[];let o=e.tool,i={...typeof e.output=="string"?{output:e.output}:{},destination:e.destination,name:e.name};if(o==="cut"){let r=S(e)?.cut;if(!r)return[];i.media={cut:r}}if(o==="mute"&&(i.media={mute:!0}),o==="speed"){let r=e.speed;if(typeof r!="number"||r===1||r<ut||r>dt)return[];i.media={speed:r}}if(o==="loudness"&&(i.media={loudness:typeof e.loudness=="number"?e.loudness:Y}),o==="cleanup"){if(!n.facts?.audio)return[];i.media={cleanup:!0,loudness:Y}}if(o==="extract"){let r=n.facts?.audio;if(!r||!n.facts?.video)return[];i.extract=!0,i.target=Q(r.codec)}if(o==="resize"){if(typeof e.resize!="object"||e.resize===null)return[];i.resize=e.resize}if(o==="rotate"){if(!n.facts?.video||!y(e.turn))return[];i.rotate=e.turn}if(o==="crop"){let r=e.crop;if(!r?.aspect||!n.facts?.video)return[];i.crop=r}return mt([n],i)}};import{dirname as lt,join as gt}from"node:path";var ht=t=>p[t.format].media==="video",bt=t=>t.length===1&&t[0]?.kind==="image"?t[0]:void 0,yt=t=>t.length===1&&t[0]?.kind==="document"?t[0]:void 0,St="-small",m={min:30,max:100,step:35},kt=t=>{let e=Math.ceil((t-m.min)/m.step);return Math.min(m.max,m.min+Math.max(0,e)*m.step)},fe={id:"compress",label:"Compress",verb:"Compressing",hint:"make it smaller",appliesTo:t=>{if(t.length===1&&t[0]?.kind==="media")return!0;let e=bt(t);if(e!==void 0){let o=p[e.format];return o.lossy||o.quantisable===!0}return(yt(t)?.images?.compressible??0)>0},options(t,e,n){let o=t[0];if(!o)return[];let i=[{kind:"select",id:"mode",label:`Compress ${h(o.path)??"this file"}`,choices:[o.kind==="media"?{value:"quality",label:"By quality"}:{value:"quality",label:"By quality",hint:"pick a level, see the result"},{value:"size",label:"To a target size",hint:"smallest quality that fits"}],default:"quality"}];if(e.mode==="quality"&&o.kind==="media"&&!ht(o))i.push({kind:"slider",id:"bitrate",label:"Quality",min:32,max:320,step:32,default:96});else if(e.mode==="quality"){let r=o.kind==="image"&&p[o.format].quantisable===!0;i.push(r?{kind:"slider",id:"quality",label:"Quality",...m,default:kt(n.quality),points:!0}:{kind:"slider",id:"quality",label:"Quality",min:1,max:100,step:5,default:n.quality})}else if(e.mode==="size")i.push({kind:"text",id:"size",label:"Target size",placeholder:"e.g. 500kb or 2mb"});else return i;return i.push(T(o,n)),i},plan(t,e){let n=e.mode;if(n!=="quality"&&n!=="size")throw k(`compressAction.plan() needs a mode of "quality" or "size", got ${JSON.stringify(n)}.`,"This is a caller bug, not a user-facing condition: walk options() before calling plan().");let o=t[0];if(!o)return[];let i=(h(o.path)??"file").replace(/\.[^.]+$/,""),r=typeof e.destination=="string"?e.destination:lt(o.path),a=o.kind==="media"?q(o.format):o.format,u=gt(r,$(i,`${St}${j(a)}`)),s=o.kind==="media"?S(e):void 0;return[{op:"convert",sources:[o],target:a,outputs:[u],options:{background:"#ffffff",keepMetadata:!1,...n==="quality"&&typeof e.quality=="number"?{quality:e.quality}:{},compress:{dither:e.dither===!0},...s?{media:s}:{}}}]}};function xt(t){return{kind:"select",id:"pages",label:"Pages",default:"all",choices:[{value:"all",label:"All pages",hint:`${t.pages} pages`},{value:"first",label:"First page only"},{value:"choose",label:"Choose pages",hint:"pick which ones"}]}}function It(){return{kind:"select",id:"dpi",label:"Resolution",default:"150",choices:[{value:"72",label:"72 dpi",hint:"screen"},{value:"150",label:"150 dpi",badge:"default"},{value:"300",label:"300 dpi",hint:"print"}]}}function zt(t,e){return Array.isArray(e)?w(e):e==="first"?[0]:typeof e=="string"&&e!=="all"&&e!==""?w(U(e,t.pages)):Array.from({length:t.pages},(n,o)=>o)}function Ot(t,e){let n=p[t.format].lossy,o=p[e].lossy;if(n&&!o)return{hint:"likely bigger",tone:"warn"};if(!n&&o)return{hint:"likely smaller",tone:"ok"}}function Mt(t){let e=_(t).filter(o=>o.id!==t.format),n=e[0];return{kind:"select",id:"target",label:`Convert ${p[t.format].label} to`,choices:e.map(o=>{let i=Ot(t,o.id);return{value:o.id,label:o.label,hint:i?.hint??o.hint,...i===void 0?{}:{tone:i.tone}}}),default:n?n.id:""}}function Tt(t){return{kind:"slider",id:"bitrate",label:"Quality",min:64,max:320,step:32,default:t==="opus"?96:128}}var Ft=t=>typeof t=="object"&&t!==null&&("percent"in t||"width"in t||"height"in t);function At(t){let e=t.target,n=typeof e=="string"?E(e):void 0;if(!n)throw k(`convertAction.plan() requires a valid target format, got ${JSON.stringify(e)}.`,"This is a caller bug, not a user-facing condition: call options() and pass one of the target select choices before calling plan().");return n}var ke={id:"convert",label:"Convert",verb:"Converting",hint:"to another format",appliesTo:t=>t.length>=1,options(t,e,n){let o=t[0];if(!o)return[];let i=[Mt(o)],r=e.target;if(typeof r!="string")return i;o.kind==="document"&&R(r)&&i.push(xt(o),It());let a=p[r];return o.kind==="media"?a?.media==="sound"&&a.lossy&&i.push(Tt(r)):a?.lossy&&a.media===void 0&&i.push({kind:"slider",id:"quality",label:"Quality",min:1,max:100,step:5,default:n.quality}),i.push(T(o,n)),i},plan(t,e){let n=t[0];if(!n)return[];let o=At(e),i=o.id,r={background:typeof e.background=="string"?e.background:"#ffffff",keepMetadata:e.keepMetadata===!0};if(o.lossy&&typeof e.quality=="number"&&(r.quality=e.quality),n.kind==="media"){let s=S(e);s&&(r.media=s),Ft(e.resize)&&(r.resize=e.resize)}let a=typeof e.destination=="string"?e.destination:void 0;if(n.kind==="document"&&R(i)){let s=Number(e.dpi);r.dpi=Number.isFinite(s)&&s>0?s:150;let f=zt(n,e.pages);r.pages=f;let et=typeof e.sourceRoot=="string"?e.sourceRoot:void 0,nt=B(n.path,f,i,a,et);return[{op:"convert",sources:[n],outputs:nt,target:i,options:r}]}let u=D({sourcePath:n.path,target:i,...a===void 0?{}:{output:`${a}/`}});return N(u,n.path)&&(u=d({sourcePath:n.path,target:i,suffix:i,...a===void 0?{}:{output:`${a}/`}})),[{op:"convert",sources:[n],outputs:[u],target:i,options:r}]}};function Rt(t,e){if(!e.rotate)return v(t,e);let n=M(e.rotate);return e.trim||e.crop||e.resize?`${v(t,e)}-${n}`:n}function v(t,e){if(e.crop){let n=I(e.crop.aspect);if(!e.resize)return n;let o=e.crop.box??x(t,e.crop.aspect);return`${n}-${b(l(o,e.resize))}`}return e.trim&&e.resize?`trimmed-${X(e.resize)}`:e.resize?b(l(t,e.resize)):"trimmed"}function wt(t,e){if(e.trim&&e.crop)throw new Error("planEdit cannot trim and crop the same image");return t.map(n=>{let o=e.target??L(n),i={background:e.background,keepMetadata:e.keepMetadata,...e.quality===void 0?{}:{quality:e.quality},...e.trim?{trim:!0}:{},...e.resize?{resize:e.resize}:{},...e.crop?{crop:e.crop}:{},...e.rotate?{rotate:e.rotate}:{}},r=e.roots?.get(n.path),a=d({sourcePath:n.path,target:o,suffix:Rt(n,e),...e.output===void 0?{}:{output:e.output},...r===void 0?{}:{sourceRoot:r}});return{op:"convert",sources:[n],outputs:[z(a,c(e.destination),c(e.name))],target:o,options:i}})}var P=t=>t.length>0&&t.every(e=>e.kind==="image")?t:void 0,Pt=t=>typeof t=="object"&&t!==null&&("percent"in t||"width"in t||"height"in t),tt=t=>typeof t=="object"&&t!==null&&"aspect"in t&&typeof t.aspect=="object"&&t.aspect!==null&&"w"in t.aspect&&"h"in t.aspect;function F(t,e,n,o){return{id:t,label:e,verb:n,hint:o,appliesTo:i=>P(i)?.every(r=>t==="resize"||r.frames<=1)===!0,unavailable:i=>P(i)?"animated":"images only",options:()=>[],plan(i,r){let a=P(i);return a?t==="crop"&&!tt(r.crop)?[]:t==="turn"&&!y(r.turn)?[]:wt(a,{trim:t==="trim"||r.trim===!0,...y(r.turn)?{rotate:r.turn}:{},...Pt(r.resize)?{resize:r.resize}:{},...tt(r.crop)?{crop:r.crop}:{},...typeof r.target=="string"?{target:r.target}:{},...typeof r.output=="string"?{output:r.output}:{},...r.roots instanceof Map?{roots:r.roots}:{},destination:r.destination,name:r.name,background:typeof r.background=="string"?r.background:"#ffffff",keepMetadata:r.keepMetadata===!0,...typeof r.quality=="number"?{quality:r.quality}:{}}):[]}}}var Fe=F("trim","Trim edges","Trimming edges","cut empty borders"),Ae=F("resize","Resize","Resizing","smaller or larger"),Re=F("crop","Crop to shape","Cropping","change the shape"),we=F("turn","Rotate","Rotating","turn it");export{Bt as a,Jt as b,_t as c,V as d,T as e,pt as f,c as g,rt as h,Ut as i,ee as j,mt as k,ne as l,fe as m,ke as n,wt as o,Fe as p,Ae as q,Re as r,we as s};
@@ -1,3 +0,0 @@
1
- import { createRequire as __forgeCreateRequire } from 'node:module';
2
- const require = __forgeCreateRequire(import.meta.url);
3
- import{a,b,c,d}from"./chunk-CW2Y2KDQ.js";import"./chunk-ZOQA3JAR.js";import"./chunk-TYWGB767.js";import"./chunk-J2UQI544.js";import"./chunk-W2QJA73Q.js";import"./chunk-ZHNPBRCX.js";import"./chunk-Q6KQWJ4J.js";import"./chunk-SNFUGJ3M.js";import"./chunk-XUKYIVJC.js";import"./chunk-GRWOJKQB.js";import"./chunk-IED6VBE6.js";import"./chunk-R24JCIZ5.js";import"./chunk-XPATZLEH.js";import"./chunk-57M4J2BR.js";import"./chunk-63XCSYHM.js";import"./chunk-RK3WGALB.js";import"./chunk-O7DK3GJT.js";import"./chunk-DYIATUFE.js";import"./chunk-EEQSUBBL.js";import"./chunk-LA5JVBFP.js";import"./chunk-K6ERQTUQ.js";import"./chunk-N6RCLJE6.js";import"./chunk-WE6KP4FR.js";import"./chunk-KH5DHZ2U.js";import"./chunk-HON4OV7M.js";import"./chunk-T37DEXUI.js";import"./chunk-J6AZTW62.js";import"./chunk-BIBDLXCG.js";import"./chunk-7KYO62XK.js";import"./chunk-CVNYUROW.js";import"./chunk-J7FLFHQJ.js";import"./chunk-VLVNA4T3.js";import"./chunk-H3DIRJFE.js";import"./chunk-KXKQDFHX.js";import"./chunk-TMUK2DD3.js";export{b as clipLines,a as runClip,d as runClipCommand,c as runUndo};
@@ -1,3 +0,0 @@
1
- import { createRequire as __forgeCreateRequire } from 'node:module';
2
- const require = __forgeCreateRequire(import.meta.url);
3
- import{a as s}from"./chunk-WE6KP4FR.js";import{E as o}from"./chunk-CVNYUROW.js";import"./chunk-J7FLFHQJ.js";import"./chunk-VLVNA4T3.js";import"./chunk-H3DIRJFE.js";import"./chunk-TMUK2DD3.js";var c=["open","convert","compress","sharpen","open-pdf","preset"];function u(r){let[e,n,...i]=r;if(e==="install"||e==="remove")return{kind:e};if(e==="run"||e==="open"){if(!c.includes(n))throw o(`No menu action called "${n??""}".`);if(n==="preset"){let[t,...a]=i;if(e!=="run"||t===void 0||!s(t))throw o(`No preset called "${t??""}".`);return{kind:"run",action:n,preset:t,paths:a}}return{kind:e,action:n,paths:i}}throw o(`No menu command called "${e??""}".`)}function m(r,e){switch(r){case"convert":return{paths:e,mode:"convert",advance:!0};case"compress":return{paths:e,mode:"compress",advance:!0};case"open-pdf":return{paths:e,mode:"pdf",advance:!1};default:return{paths:[],mode:"convert",advance:!1}}}export{m as openedFor,u as parseMenuArgs};
@@ -1,3 +0,0 @@
1
- import { createRequire as __forgeCreateRequire } from 'node:module';
2
- const require = __forgeCreateRequire(import.meta.url);
3
- import{c as a,d as b,e as c,f as d}from"./chunk-J2UQI544.js";import"./chunk-W2QJA73Q.js";import"./chunk-ZHNPBRCX.js";import"./chunk-Q6KQWJ4J.js";import"./chunk-SNFUGJ3M.js";import"./chunk-XUKYIVJC.js";import"./chunk-GRWOJKQB.js";import"./chunk-IED6VBE6.js";import"./chunk-R24JCIZ5.js";import"./chunk-XPATZLEH.js";import"./chunk-57M4J2BR.js";import"./chunk-63XCSYHM.js";import"./chunk-RK3WGALB.js";import"./chunk-O7DK3GJT.js";import"./chunk-DYIATUFE.js";import"./chunk-EEQSUBBL.js";import"./chunk-LA5JVBFP.js";import"./chunk-K6ERQTUQ.js";import"./chunk-N6RCLJE6.js";import"./chunk-WE6KP4FR.js";import"./chunk-KH5DHZ2U.js";import"./chunk-HON4OV7M.js";import"./chunk-T37DEXUI.js";import"./chunk-J6AZTW62.js";import"./chunk-BIBDLXCG.js";import"./chunk-7KYO62XK.js";import"./chunk-CVNYUROW.js";import"./chunk-J7FLFHQJ.js";import"./chunk-VLVNA4T3.js";import"./chunk-H3DIRJFE.js";import"./chunk-KXKQDFHX.js";import"./chunk-TMUK2DD3.js";export{d as execute,a as exitCodeFor,c as renderRun,b as runIntent};